Обсуждение: unexpected EOF on client connection vs 9.0.3

Поиск
Список
Период
Сортировка

unexpected EOF on client connection vs 9.0.3

От
Piotr Czekalski
Дата:
Hello there,

I'm getting regular Postgres log entries with the following error:
2011-03-07 01:00:01 CET LOG:  could not receive data from client: No
connection could be made because the target machine actively refused it.
2011-03-07 01:00:01 CET LOG:  unexpected EOF on client connection

They always appear together.
The server is PostgreSQL 9.0.3, compiled by Visual C++ build 1500,
64-bit running on Windows 2008 R2 SP1 x64, the client is a ASP.NET
application running npgsql.

I've checked and verified that all connections are closed within the
code, what's more, the problem has appeared just as I've moved server
from Fedora Linux x86_64 running Postgres 8.4.2 to the Windows and 9.0.3
(details above) thus I conclude this is not a client problem indeed (the
failure didn't occure on Linux).
The connections are closed from time to time immediatelly as I get
ASP.NET errors.

Thanks for any help in advance.

Piotr Czekalski

P.S. The connection string is:
...Server=127.0.0.1;Port=5432;User Id=<user here>;Password=<password
here>;Database=<database here>;CommandTimeout=360;" providerName="Npgsql"...
--

--------------------------------------------------------------
"TECHBAZA.PL" Sp. z o.o.
Technologie WEB, eDB&  eCommerce
tel. (+4832) 7186081
fax. (+4832) 7003289
email: biuro@techbaza.pl



Re: unexpected EOF on client connection vs 9.0.3

От
Craig Ringer
Дата:
On 08/03/11 02:49, Piotr Czekalski wrote:

> I've checked and verified that all connections are closed within the
> code, what's more, the problem has appeared just as I've moved server
> from Fedora Linux x86_64 running Postgres 8.4.2 to the Windows and 9.0.3
> (details above) thus I conclude this is not a client problem indeed (the
> failure didn't occure on Linux).

Windows firewall?

You can also see these error reports when the connections are closed
uncleanly, without a proper backend close message. Perhaps you have
client processes crashing? Or doing hard shutdowns where the client code
doesn't get a chance to run any cleanup/dtors/etc?

--
Craig Ringer

Re: unexpected EOF on client connection vs 9.0.3

От
rsmogura
Дата:
 On Tue, 08 Mar 2011 11:30:10 +0800, Craig Ringer wrote:
> On 08/03/11 02:49, Piotr Czekalski wrote:
>
>> I've checked and verified that all connections are closed within the
>> code, what's more, the problem has appeared just as I've moved
>> server
>> from Fedora Linux x86_64 running Postgres 8.4.2 to the Windows and
>> 9.0.3
>> (details above) thus I conclude this is not a client problem indeed
>> (the
>> failure didn't occure on Linux).
>
> Windows firewall?
>
> You can also see these error reports when the connections are closed
> uncleanly, without a proper backend close message. Perhaps you have
> client processes crashing? Or doing hard shutdowns where the client
> code
> doesn't get a chance to run any cleanup/dtors/etc?
>
> --
> Craig Ringer

 I think in 8.x releases is no need to make any spacial close operation,
 or at least You do not get notice, about it. Closing socket is enough.
 E.g. JDBC driver closes connection, by closing socket. In 9 this changed
 and I see many of such notices in log. Probably Your driver, as many
 others, is written to close socket without backanad message.

 Regards,
 Radek

Re: unexpected EOF on client connection vs 9.0.3

От
"Francisco Figueiredo Jr."
Дата:
Indeed those messages appear when the client closes the socket connection only.

Npgsql has connection pooling and if the app domain is unloaded and
there are connections in the pool, those connections don't get a
chance to have the Close message sent to backend server.

So, even when you are correctly closing your connection, you still
will see those messages.

You can prevent that from appearing by disabling the connection
pooling. Which I advise against.

Also, you may want to check if your domain app is being unloaded for
some reason.

I never see any harm being done because the connection exited without
sending the close message. So I think you could (safely?) ignore this
message on this case.

I hope it helps.


On Tue, Mar 8, 2011 at 05:50, rsmogura <rsmogura@softperience.eu> wrote:
> On Tue, 08 Mar 2011 11:30:10 +0800, Craig Ringer wrote:
>>
>> On 08/03/11 02:49, Piotr Czekalski wrote:
>>
>>> I've checked and verified that all connections are closed within the
>>> code, what's more, the problem has appeared just as I've moved server
>>> from Fedora Linux x86_64 running Postgres 8.4.2 to the Windows and 9.0.3
>>> (details above) thus I conclude this is not a client problem indeed (the
>>> failure didn't occure on Linux).
>>
>> Windows firewall?
>>
>> You can also see these error reports when the connections are closed
>> uncleanly, without a proper backend close message. Perhaps you have
>> client processes crashing? Or doing hard shutdowns where the client code
>> doesn't get a chance to run any cleanup/dtors/etc?
>>
>> --
>> Craig Ringer
>
> I think in 8.x releases is no need to make any spacial close operation, or
> at least You do not get notice, about it. Closing socket is enough. E.g.
> JDBC driver closes connection, by closing socket. In 9 this changed and I
> see many of such notices in log. Probably Your driver, as many others, is
> written to close socket without backanad message.
>
> Regards,
> Radek
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>



--
Regards,

Francisco Figueiredo Jr.
Npgsql Lead Developer
http://www.npgsql.org
http://fxjr.blogspot.com
http://twitter.com/franciscojunior