Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1smvfq-008var-PC for pgsql-hackers@arkaria.postgresql.org; Sat, 07 Sep 2024 13:40:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1smv6r-00GAco-4m for pgsql-hackers@arkaria.postgresql.org; Sat, 07 Sep 2024 13:04:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1smv6q-00GAcg-PM for pgsql-hackers@lists.postgresql.org; Sat, 07 Sep 2024 13:04:13 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1smv6p-000bYk-JK for pgsql-hackers@postgresql.org; Sat, 07 Sep 2024 13:04:12 +0000 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-53567b4c3f4so2826599e87.2 for ; Sat, 07 Sep 2024 06:04:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725714249; x=1726319049; darn=postgresql.org; h=content-transfer-encoding:to:subject:from:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=KK1ED6IF1/F0GghMkyMr+ZskbV7Nx9agLUSB/4wzgrg=; b=hw7sDOa5pbp9pds1XPdprLRWUqkpv/8+dQCL1erlLtrAQ0BdpdaB/usDBynSShKuhV lVIVJSv5voQVauJETmpwpKtVc+iQLX0c5lJwnFL4YE9e2revucCPYbQq4IzgNHNc16fc PsSIBmcZJOsbFaEKkYfTtafDphZZFLBPEPAk9LmJLOBV9ABr5biS3mAIwxGtR/58YxYf cuzPca2psERB3dulbV0GE4Dl+qhJT2YYOiV9VhVf7M8ZV8q4aPJFeLaJC3QjLIFEa1MD 15IyDe8LS1EIwwKT4nlxsTuteDdtR66bmMCn3tNgYQXTvPmIZ0psYRhYspOodCwqmlTX MbDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725714249; x=1726319049; h=content-transfer-encoding:to:subject:from:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=KK1ED6IF1/F0GghMkyMr+ZskbV7Nx9agLUSB/4wzgrg=; b=mE28pp0YpAPiUOKhQYQcXIhIU5GZ+Fp4J5icW3g+yNYQgoVFAR+s9hQpu4jc2nH1Mx AyIamYUMqoo+qnXgeeqdHGAwl9BDLLmyXSQe7p0FXphda+oUT58LiBB8hIWX5q/TOuQu SM0PGK3lMbXb1EeiUJyyS8PlYhWtWtlDlpk0Gr7lxbo7h2e7NhZPmoBxmzRoj2jakH3r YNWlunPDRWqJ28DD7xZyZPJE6HRGcRFV2gRAol6MMNNYiOdxUCe0s8tAXlJG6rQEBna9 oDqYMqPkv3IkgvWNPe+y3wh7aPVr2l2JMhY41O/Bo03B11L9agSb2kMIxnX3U1I0Vp19 EaZQ== X-Gm-Message-State: AOJu0YwoODxISb/iz7bCGr3Mp4xwUuNo4GEYOHAU5o0tDxq0/9aiHnwg Z6RFuOvvYldmAVlNjJy7wiW0JmycjUXwRCYjEC2nO43CYV3tsHDJG9zX8Mkf X-Google-Smtp-Source: AGHT+IHwuCTEtzdytkqYClfp0hgIkjltTGfRt7aLb3khj+QM6RCDy/HBvw+CNottVov54RAHt16zSA== X-Received: by 2002:a05:6512:2348:b0:52e:74d5:89ae with SMTP id 2adb3069b0e04-536587ef299mr3370674e87.39.1725710401552; Sat, 07 Sep 2024 05:00:01 -0700 (PDT) Received: from [1.0.0.7] ([178.155.16.7]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5365f90d3c0sm131013e87.259.2024.09.07.05.00.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 07 Sep 2024 05:00:01 -0700 (PDT) Message-ID: Date: Sat, 7 Sep 2024 15:00:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Content-Language: en-US From: Alexander Lakhin Subject: Yet another way for pg_ctl stop to fail on Windows To: pgsql-hackers , Noah Misch 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 Hello hackers, While trying to reproduce a recent fairywren (a Windows animal) failure, I ran amcheck/amcheck/003_cic_2pc in parallel inside a slowed-down VM and came across another issue: ### Stopping node "CIC_2PC_test" using mode fast # Running: pg_ctl -D C:\src\postgresql\build/testrun/amcheck_17/003_cic_2pc\data/t_003_cic_2pc_CIC_2PC_test_data/pgdata -m fast stop waiting for server to shut down..... failed pg_ctl: server does not shut down # pg_ctl stop failed: 256 # Postmaster PID for node "CIC_2PC_test" is 6048 [08:24:52.915](12.792s) Bail out!  pg_ctl stop failed So "pg_ctl stop" failed due to not a timeout, but some other reason. With extra logging added, I got: ### Stopping node "CIC_2PC_test" using mode fast # Running: pg_ctl -D C:\src\postgresql\build/testrun/amcheck_3/003_cic_2pc\data/t_003_cic_2pc_CIC_2PC_test_data/pgdata -m fast stop waiting for server to shut down......!!!pgkill| GetLastError(): 231 postmaster (9596) died untimely? res: -1, errno: 22  failed Thus, CallNamedPipe() in pgkill() returned ERROR_PIPE_BUSY (All pipe instances are busy) and it was handled as an unexpected error. (The error code 231 returned 10 times out of 10 failures of this ilk for me.) Noah, what do you think of handling this error in line with handling of ERROR_BROKEN_PIPE and ERROR_BAD_PIPE (which was done in 0ea1f2a3a)? I tried the following change:         switch (GetLastError())         {                 case ERROR_BROKEN_PIPE:                 case ERROR_BAD_PIPE: +               case ERROR_PIPE_BUSY: and saw no issues. The reason I'd like to bring your attention to the issue (if you don't mind), is that it's impossible to understand the reason of such false failure if it happens in the buildfarm/CI. Best regards, Alexander