Unexpected EOF on client connection

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

Unexpected EOF on client connection

От:
Matthias Brunner <mb@blumenstrasse.vol.at>
Дата:
Hello,

whenever I close a JDBC connection, the following log message is printed:
DEBUG:  pq_recvbuf: unexpected EOF on client connection

I searched the archive and found messages about the issue dating back to 2001. 
Since then, this "bug" has not been fixed.
Whereas it does not seem to be a real problem, it is quite irritating 
especially for new users like me (log messages about errors should only be 
printed when "real" errors occure).

What can be done about this?

Software used: postgresql 7.2, JDBC driver for 7.2, Sun JDK 1.4, Linux
-- 
Matthias Brunner 
PGP FP 7862 32B3 3B75 292A F76F  5042 8587 21AB 5B89 D501
Check out http://blumenstrasse.vol.at/~mb/gpgkey.asc

Re: Unexpected EOF on client connection

От:
Barry Lind <barry@xythos.com>
Дата:
Matthias,

I am not aware of any bug like this.  This problem used to exist in the 
7.0 drivers but was fixed a long time ago.  I certainly don't see this 
in my applications.  Are you sure you are calling Connection.close()? 
 If you don't close the connection properly then you will see this 
message.  If you can reproduce please send a test case to the mail list 
and we will look at the problem.

thanks,
--Barry

Matthias Brunner wrote:

>Hello,
>
>whenever I close a JDBC connection, the following log message is printed:
>DEBUG:  pq_recvbuf: unexpected EOF on client connection
>
>I searched the archive and found messages about the issue dating back to 2001. 
>Since then, this "bug" has not been fixed.
>Whereas it does not seem to be a real problem, it is quite irritating 
>especially for new users like me (log messages about errors should only be 
>printed when "real" errors occure).
>
>What can be done about this?
>
>Software used: postgresql 7.2, JDBC driver for 7.2, Sun JDK 1.4, Linux
>  
>


Re: Unexpected EOF on client connection

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Matthias Brunner  writes:
> whenever I close a JDBC connection, the following log message is printed:
> DEBUG:  pq_recvbuf: unexpected EOF on client connection

This appears to be fixed in current sources, where I read:

        public void close() throws SQLException
        {
                if (pg_stream != null)
                {
                        try
                        {
                                pg_stream.SendChar('X');
                                pg_stream.flush();
                                pg_stream.close();
                        }
                        catch (IOException e)
                        {}
                        pg_stream = null;
                }
        }

        public void finalize() throws Throwable
        {
                close();
        }

Without this, destroying the JDBC connection simply results in
unceremoniously closing the TCP connection.  If you do that without
sending 'X', the backend complains ...

			regards, tom lane

Re: Unexpected EOF on client connection

От:
Matthias Brunner <mb@blumenstrasse.vol.at>
Дата:
On Wednesday 14 August 2002 17:58, Barry Lind wrote:
> Matthias,
>
> I am not aware of any bug like this.  This problem used to exist in the
> 7.0 drivers but was fixed a long time ago.  I certainly don't see this
> in my applications.  Are you sure you are calling Connection.close()?
>  If you don't close the connection properly then you will see this
> message.  If you can reproduce please send a test case to the mail list
> and we will look at the problem.

Really strange. I tried it again (as I remember without changing anything in 
the code) and couldn't reproduce it. Probably I'm just a dumbass. Sorry for 
bothering you and thanks for both your rapid answers.

BTW: Shouldn't Connection.close() be called from Connection.finalize() if the 
connection is still open? The mysql JDBC driver does this.

Cheers!
-- 
Matthias Brunner 
PGP FP 7862 32B3 3B75 292A F76F  5042 8587 21AB 5B89 D501
Check out http://blumenstrasse.vol.at/~mb/gpgkey.asc
FAQ