Weird error messages from Windows upon client death

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Weird error messages from Windows upon client death
Date: 2014-01-28 18:19:47
Message-ID: CAMkU=1xm0TLATM9YoeECcspdHX0eTypND+N2iOZCEAx2uUHtqg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On windows, if the client gets terminated while sending data to the server,
in a COPY for example, it results in some rather head-scratcher messages in
the server log, for example:

LOG: could not receive data from client: No connection could be made
because the target machine actively refused it.

Since the server was reading from the client and never tries to initiate a
connection, the %m part of the message is a bit baffling. The errno at
this point is 10061.

Googling for "No connection could be made because the target machine
actively refused it", I can't find any mentions for it that occur in a
context in which a connection is not being attempted, except for from
PostgreSQL. So I think we must be doing something wrong but I can't figure
out what that would be (no strace, not gdb). Any tips on how to figure out
why this is happening?

I run the below, and then terminated it with a ctrl-C. This is with 9.4dev
compiled with MinGW, but I've seen (unconfirmed by me) reports of the same
%m from the Windows binary distribution for a production version.

perl -le 'print rand() foreach 1..10000000' | psql -c 'copy foo from stdin'

Cheers,

Jeff

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2014-01-28 18:22:41 Re: new json funcs
Previous Message Josh Berkus 2014-01-28 18:11:39 Re: new json funcs