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 1kWY8k-0006v6-PC for pgsql-bugs@arkaria.postgresql.org; Sun, 25 Oct 2020 05:00:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kWY8h-0004GB-7L for pgsql-bugs@arkaria.postgresql.org; Sun, 25 Oct 2020 05:00:19 +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 1kWY8g-0004G4-E8 for pgsql-bugs@lists.postgresql.org; Sun, 25 Oct 2020 05:00:18 +0000 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kWY8T-00071q-De for pgsql-bugs@lists.postgresql.org; Sun, 25 Oct 2020 05:00:17 +0000 Received: by mail-lf1-x142.google.com with SMTP id h6so7477804lfj.3 for ; Sat, 24 Oct 2020 22:00:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=4K7CzFA7eJNLcxs51lxkdcY+RAlu/uwCy8U9lznBmLI=; b=cMz3KxZeOmsJ0IEZH8lUszuHp5hRt2eIOsoEuMH5NObG7SF1WIP37JLCWl8PKOBEgK /TaD4k/J511Ab0JbyrRO1XcSr6/4J10vUbaL+Q1senIyJR0yMfhpMPBdafSZIG4p9KVo ocvwsen2Ts01govKAgbPI+4M9fmHc1+38H/JX1MZY1MqLKAiXxN/8qwwtJnB5fVBn00F fGNnlMlD2SeKuM8UsNzOCG1dRc8yYaLEQSdFrs6QXYvDKRKRlvlYVyJIOODlKiWm1/Ka gB0EL2PN2654Nle0wpDP/YAWfrERlv9yApsD6ek6lbOcRM9qsYOfSOGrQcAb9XtwKbys zasw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=4K7CzFA7eJNLcxs51lxkdcY+RAlu/uwCy8U9lznBmLI=; b=ds18C+QjzhT3YbzwE8w2MH0FD9ckiliIB2etIL7ndwi7odQS/qnTXm94UYV20PFjNU X+TRGsNd64EsUPcEP25z06kZ9XTug4iW1ijXLkyKh5m5Z/lWsjTDreuHPoGKa9xBClWo W9qV1Bj3YUNPEYJ5yIpfzQ9U5Kb6Gtqdqcw7MWr+OvHVVuLvOj+KZm4hQnFu2Q0+Kn7k IRqOVlTHiZIQg1CfxDLibgTmQ9JxQE43rwtER6yqC5pB3hhHQPdt7TOBg1r3IE8RIvn0 J6mgKcIDIJYrQQU32ncvwXGmZ3C6rSwuTl1sBBLuJfBWHy/tDEvbsEtHBifagYB2u5xm jkqA== X-Gm-Message-State: AOAM532lXUr+sRVFyMU1obZPCdnsq64MaEtGMhSVnzkVoTPHiOrFpD+2 D8WMDHMlTpyGna7PpUxP8//p5EVy6OE= X-Google-Smtp-Source: ABdhPJz8F6y1mgooFJ9yotbaQl2cBFvqviQ2dFBdA8/9XUq/xn87cquqFneSVf6+imfRKjIiWVOHiQ== X-Received: by 2002:a19:2302:: with SMTP id j2mr2819770lfj.78.1603602002409; Sat, 24 Oct 2020 22:00:02 -0700 (PDT) Received: from [1.0.0.7] ([178.155.6.144]) by smtp.gmail.com with ESMTPSA id r9sm618971lff.216.2020.10.24.22.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 24 Oct 2020 22:00:01 -0700 (PDT) Subject: Re: BUG #16678: The ecpg connect/test5 test sometimes fails on Windows To: Tom Lane Cc: pgsql-bugs@lists.postgresql.org References: <16678-253e48d34dc0c376@postgresql.org> <434311.1603135136@sss.pgh.pa.us> <383222.1603561145@sss.pgh.pa.us> <392145.1603573643@sss.pgh.pa.us> From: Alexander Lakhin Message-ID: Date: Sun, 25 Oct 2020 08:00:00 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <392145.1603573643@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 25.10.2020 00:07, Tom Lane wrote: > Alexander Lakhin writes: >> But I'm inclined to stay on the previous level with "shutdown && >> closesocket" as recommended for server side: >> https://docs.microsoft.com/en-us/windows/win32/winsock/graceful-shutdown-linger-options-and-socket-closure-2 >> Please look at the draft patch. > If that actually fixes things, I'm okay with it --- do you find > that it prevents the test failure even with client-side delays? Yes, the connect/test5 test passes even with 1 sec delay: C:\src\postgresql\src\tools\msvc>vcregress ecpgcheck Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Framework Copyright (C) Microsoft Corporation. All rights reserved. Build started 10/25/2020 7:58:25 AM. ... ============== running regression test queries        ============== test compat_informix/dec_test     ... ok           27 ms test compat_informix/charfuncs    ... ok           14 ms test compat_informix/rfmtdate     ... ok           12 ms test compat_informix/rfmtlong     ... ok           12 ms test compat_informix/rnull        ... ok        23337 ms test compat_informix/sqlda        ... ok        56734 ms test compat_informix/describe     ... ok        35485 ms test compat_informix/test_informix ... ok        41592 ms test compat_informix/test_informix2 ... ok        21336 ms test compat_oracle/char_array     ... ok        39457 ms test connect/test2                ... ok        18274 ms test connect/test3                ... ok        15276 ms test connect/test4                ... ok         3073 ms test connect/test5                ... ok        45866 ms test pgtypeslib/dt_test           ... ok        15200 ms test pgtypeslib/dt_test2          ... ok           12 ms test pgtypeslib/num_test          ... ok        11188 ms ... test sql/prepareas                ... ok       148876 ms test thread/thread                ... ok        90417 ms test thread/thread_implicit       ... ok        91290 ms test thread/prep                  ... ok       258438 ms test thread/alloc                 ... ok       150070 ms test thread/descriptor            ... ok           79 ms ============== shutting down postmaster               ============== ============== removing temporary instance            ============== ======================  All 60 tests passed. ====================== And regarding the src/test/recovery test failure with a 10 ms delay added... I've increased a log level and get probably the same behaviour as described in https://www.postgresql.org/message-id/flat/OFCA523F90.7499E22F-ON4325828E.005573C4-4325828E.0055B412%40iba.by The primary node can't finish smart shutdown and logs of the primary and the standby are filling with the following messages: 2020-10-25 07:37:39.830 MSK [1065932] standby_1 DEBUG:  sending replication keepalive 2020-10-25 07:37:39.840 MSK [1065932] standby_1 DEBUG:  write 0/30000A0 flush 0/3000000 apply 0/3000000 reply_time 2020-10-25 07:37:39.840277+03 2020-10-25 07:37:39.840 MSK [1065932] standby_1 DEBUG:  sending replication keepalive 2020-10-25 07:37:39.850 MSK [1065932] standby_1 DEBUG:  write 0/30000A0 flush 0/3000000 apply 0/3000000 reply_time 2020-10-25 07:37:39.850389+03 2020-10-25 07:37:39.850 MSK [1065932] standby_1 DEBUG:  sending replication keepalive 2020-10-25 07:37:39.860 MSK [1065932] standby_1 DEBUG:  write 0/30000A0 flush 0/3000000 apply 0/3000000 reply_time 2020-10-25 07:37:39.860486+03 ... 2020-10-25 07:37:39.830 MSK [1065931] DEBUG:  sending write 0/30000A0 flush 0/3000000 apply 0/3000000 2020-10-25 07:37:39.840 MSK [1065931] DEBUG:  sendtime 2020-10-25 07:37:39.83022+03 receipttime 2020-10-25 07:37:39.840262+03 replication apply delay 0 ms transfer latency 10 ms 2020-10-25 07:37:39.840 MSK [1065931] DEBUG:  sending write 0/30000A0 flush 0/3000000 apply 0/3000000 2020-10-25 07:37:39.850 MSK [1065931] DEBUG:  sendtime 2020-10-25 07:37:39.840331+03 receipttime 2020-10-25 07:37:39.850364+03 replication apply delay 0 ms transfer latency 10 ms 2020-10-25 07:37:39.850 MSK [1065931] DEBUG:  sending write 0/30000A0 flush 0/3000000 apply 0/3000000 2020-10-25 07:37:39.860 MSK [1065931] DEBUG:  sendtime 2020-10-25 07:37:39.850438+03 receipttime 2020-10-25 07:37:39.860468+03 replication apply delay 0 ms transfer latency 10 ms ...   Though the patch proposed by Kyotaro Horiguchi doesn't help. It this looks like an issue that should be fixed, I can investigate it further. Best regards, Alexander