Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n8LU9-0006Az-3J for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Jan 2022 12:15:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n8LU8-0005Vs-2Z for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Jan 2022 12:15:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n8LU7-0005VX-Ki for pgsql-hackers@lists.postgresql.org; Fri, 14 Jan 2022 12:15:11 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n8LU4-0006hi-My for pgsql-hackers@postgresql.org; Fri, 14 Jan 2022 12:15:10 +0000 Received: from [192.168.31.63] (unknown [62.217.188.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 40D2C21C34F6; Fri, 14 Jan 2022 15:15:06 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1642162506; bh=mWprsNxerFxjX9IxzMcq/PwQs3zApUgoW/1RjKlCN1s=; h=Date:Subject:From:To:Cc:References:In-Reply-To; b=W7dx1T/3PKxXVn3QjY2OBblnUGh8k9G+8ppj8qwhq2In3DBEaYR9BtdNvXJ3dSvys +P1b5eXvVR613yQSgV7M3zcRkzCL6nhEY3SEMiHYwhS+d7sS5bHff2o4s2D/P6bbyN vb4gCjj8rn9pQG6oSKEMW+guie07y5iUzQcliTTo= Message-ID: <4542bf4e-9eae-9622-e351-ee96b48f05df@postgrespro.ru> Date: Fri, 14 Jan 2022 15:15:05 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: Windows: Wrong error message at connection termination Content-Language: en-US From: Sergey Shinderuk To: Tom Lane , Alexander Lakhin Cc: Lars Kanis , Thomas Munro , pgsql-hackers References: <90b34057-4176-7bb0-0dbb-9822a5f6425b@greiz-reinsdorf.de> <2858709.1637201040@sss.pgh.pa.us> <6dad5499-ced4-ac82-4f5d-fb6311378176@greiz-reinsdorf.de> <3616081.1637530966@sss.pgh.pa.us> <3627376.1637535867@sss.pgh.pa.us> <1283317.1638213407@sss.pgh.pa.us> <3a497c66-6685-c1c1-1eb4-1636e9ac5442@gmail.com> <2120381.1638473504@sss.pgh.pa.us> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 14.01.2022 13:01, Sergey Shinderuk wrote: > When the timeout expires, the server sends the error message and > gracefully closes the connection by sending a FIN.  Later, psql sends > another query to the server, and the server responds with a RST.  But > now recv() returns WSAECONNABORTED(10053) instead of WSAECONNRESET(10054). On the other hand, I cannot reproduce this behavior with a remote server even if pause psql just before the recv() call to let the RST win the race. So I get: postgres=# set idle_session_timeout = '1s'; recv() returned 15 errno 0 SET recv() returned -1 errno 10035 (WSAEWOULDBLOCK) postgres=# select 1; recv() returned 116 errno 0 recv() returned 0 errno 0 recv() returned 0 errno 0 FATAL: terminating connection due to idle-session timeout server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. recv() signals EOF like on Unix. Here I connected from a Windows virtual machine to the macOS host, but the Wireshark dump looks the same (there is a RST) as for a localhost connection. Is this "error-eating" behavior of RST on Windows specific only to localhost connections? -- Sergey Shinderuk https://postgrespro.com/