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 1pPwjB-0007cU-Qc for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Feb 2023 02:32:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pPwjA-00035e-LH for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Feb 2023 02:32:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pPwjA-00033t-9w for pgsql-hackers@lists.postgresql.org; Thu, 09 Feb 2023 02:32:00 +0000 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pPwj6-00064G-0m for pgsql-hackers@lists.postgresql.org; Thu, 09 Feb 2023 02:31:59 +0000 Received: by mail-pf1-x435.google.com with SMTP id a5so413158pfv.10 for ; Wed, 08 Feb 2023 18:31:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=ONHH6rrMK8B4ocasXtJiKzuhnuJiQzjfSREyXzXMPN0=; b=QNbbXWXFUDeTSu2IfBCURzeMhqdoVnMJlK//lk3SnuwQLxYQCKoo0dxicuvbaRv+Kc vEYBoXJyyrLJf6Ns/JgzXBjB12HW5IonUYyFZR8uQzc1vUCsa/j0IXtVkxqwsNwGzd7f kD9SycaS0bfGRm5tnNGEAsQcXynbPSSsZjIqwkpcPdATx6uwBSppvYRWD62yasW3OAFE aPfyKndDB+SAHspSHGsLMVmwkAUuZsy0G8tLYhTosI5hPLWKlA3ezO/PQsQqUP0sTZ77 kMxakNORI6fXhrnGxUIrotnrTxwrfd7lChEK6CdevnVv0ThLgkFZZ590sVeQe8D02q/X m9Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ONHH6rrMK8B4ocasXtJiKzuhnuJiQzjfSREyXzXMPN0=; b=WjXycpjlMFy8MsoNKGSiVDGEAU+a7WBnjIhgbq86bzLCM1iUwm3nMAeWO9HVYEZ27M sFenLXUOFIVdXA+Tb+wMUK3uiKEaVJS/t0ZjclIZKSUvHJ5m4ELsd0byfABv3qCSYZJ+ ZQRg0WmVaY8pYGJZ0NNFeTvSkD47hbWZDXOIifpVK0u8jIcvUmlzys8v0siHHqXDFtmI 7mUKCbSbaXwCDcoCzFOLoDAuOXu0Zrj9YL2Ql7OgF+BWSdekVi1KWYAk9NF1nKl9ywPk cIa1DQZzHiU37mujGE8/TN5IaHkPWx8mNnMf9rVB6BlVjS55yqdj7z4edsUsD5V+NmBu jI2w== X-Gm-Message-State: AO0yUKWSFTG+C34mG2/dm3MSibN7RS4yolOXYCSRpWZBc4lxqN7l9Nqv zHGQkOU+Ekn61bFFcJI7oIs= X-Google-Smtp-Source: AK7set9ZwDUZpXOMChFbnvrw5ZethrLqcDhonMD+APLIqfZsTolT8SCO7C/IRgIDlQWpxy8xdLUrUA== X-Received: by 2002:a62:64d8:0:b0:5a8:1877:37ed with SMTP id y207-20020a6264d8000000b005a8187737edmr3978691pfb.11.1675909913475; Wed, 08 Feb 2023 18:31:53 -0800 (PST) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id v17-20020a62a511000000b005825b8e0540sm112850pfm.204.2023.02.08.18.31.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 08 Feb 2023 18:31:52 -0800 (PST) Date: Thu, 09 Feb 2023 11:31:49 +0900 (JST) Message-Id: <20230209.113149.2028095933259376311.horikyota.ntt@gmail.com> To: kuroda.hayato@fujitsu.com Cc: katsuragiy@oss.nttdata.com, yuzhihong@gmail.com, tgl@sss.pgh.pa.us, vignesh21@gmail.com, pgsql-hackers@lists.postgresql.org, onderkalaci@gmail.com, masao.fujii@oss.nttdata.com, Shinya11.Kato@oss.nttdata.com Subject: Re: [Proposal] Add foreign-server health checks infrastructure From: Kyotaro Horiguchi In-Reply-To: References: User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk At Fri, 27 Jan 2023 06:57:01 +0000, "Hayato Kuroda (Fujitsu)" wrote in > I found cfbot failure, PSA fixed version. + Unlike , this function checks socket + health. This check is performed by polling the socket. This function is + currently available only on systems that support the non-standard + POLLRDHUP extension to the poll system I find it quite confusing that we have pqSocketCheck and PQconnCheck, that does almost the same thing.. Since pqSocketCheck is a static function, we can modify the function as we like. I still don't understand why we need pqconnCheck_internal separate from pqSocketPoll(), and PQconnCheck from pqSocketCheck. https://www.postgresql.org/message-id/flat/TYAPR01MB58665BF23D38EDF10028DE2AF5299%40TYAPR01MB5866.jpnprd01.prod.outlook.com#47d21431bf9fa94f763c824f6e81fa54 > IIUC, pqSocketCheck () calls pqSocketPoll(), > and in the pqSocketPoll() we poll()'d the POLLIN or POLLOUT event. > But according to [1], we must wait POLLRDHUP event, > so we cannot reuse it straightforward. Yeah, I didn't suggest to use the function as-is. Couldn't we extend the fucntion by letting it accept end_time = 0 && !forRead && !forWrite, not causing side effects? regards. -- Kyotaro Horiguchi NTT Open Source Software Center