Bonjour,

J'utilise une BDD postgresql.
Generalement tout fonctionne bien sauf que par moment je me retrouve avec un etat BROKEN.


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
System.IO.IOException: IO exception during read. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.BeginReceive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, AsyncCallback callback, Object state)
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
   at Mono.Security.Protocol.Tls.SslStreamBase.InternalBeginRead(InternalAsyncResult asyncResult)
   --- End of inner exception stack trace ---
   at Mono.Security.Protocol.Tls.SslStreamBase.InternalBeginRead(InternalAsyncResult asyncResult)
   at Mono.Security.Protocol.Tls.SslStreamBase.BeginRead(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state)
   at Mono.Security.Protocol.Tls.SslStreamBase.Read(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.BufferedStream.ReadByte()
   at Npgsql.NpgsqlState.ProcessBackendResponses_Ver_3(NpgsqlConnector context)
   at Npgsql.NpgsqlState.ProcessBackendResponses(NpgsqlConnector context)
   at Npgsql.NpgsqlReadyState.Query(NpgsqlConnector context, NpgsqlCommand command)
   at Npgsql.NpgsqlConnector.Query(NpgsqlCommand queryCommand)
   at Npgsql.NpgsqlCommand.ExecuteCommand() Npgsql.NpgsqlException:
The Connection is broken.
   at Npgsql.NpgsqlCommand.ClearPoolAndThrowException(Exception e)
   at Npgsql.NpgsqlCommand.ExecuteCommand()
   at Npgsql.NpgsqlCommand.ExecuteNonQuery()
   at Utils.ConnectionOpen(NpgsqlConnection conn) 
 
 Etat de la connexion Open
Quand cela arrive je ne peux plus me connecter a la bdd pendant environ 10 sec.

La meme requete pourra passer X fois sans probleme puis bloque X fois avant de pouvoir repasser normalement (ce n'est donc pas un probleme dans la requete).

Les connexion a la bdd sont bien fermees quand on n'en plus besoin.
(Utilisation d'un using + finally pour etre sur que ce soit ferme).

On utilise la chaine de connexion suivante:
"Server=x.x.x.x;Port=5432;User Id=xxx;Password=xxx;Database=mabdd;ssl=true;MaxPoolSize=40;"

Le nombre max de connexion autorise a la bdd n'est pas atteint.

Et la franchement on n'a plus d'idée sur ce qui peut provoquer ce probleme

Si quelqu'un avait une piste elle serait la bienvenue.

Merci d'avance