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.96) (envelope-from ) id 1wcNVq-003Iwq-0H for pgpool-hackers@arkaria.postgresql.org; Wed, 24 Jun 2026 13:19:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wcNVo-000yvW-1s for pgpool-hackers@arkaria.postgresql.org; Wed, 24 Jun 2026 13:19:28 +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.96) (envelope-from ) id 1wcNVo-000yvO-1K for pgpool-hackers@lists.postgresql.org; Wed, 24 Jun 2026 13:19:28 +0000 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wcNVl-000000001t0-2r3x for pgpool-hackers@lists.postgresql.org; Wed, 24 Jun 2026 13:19:27 +0000 Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-37cab825ec9so802521a91.1 for ; Wed, 24 Jun 2026 06:19:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1782307163; cv=none; d=google.com; s=arc-20240605; b=C5rChBvH/T7J4SgPB8c9XT4CbkSgpKmV+9totTQDvgluLmPlceQRNoAo3DT2/lZHF8 fEif0S5h8eEwQHoqj8qi1FNi68Tnm34dlkGGdgSIcpz/hgQc8ZbckLSh2AL9T69yVKnB 52sJ/AhTkFpayKUECjGxtGis4QDTUJSSSRWSgEXXf0SFytVgZCBqDaax6tmd7pxng64F 2O3dr5yJ5Bl8Z/sGUm70tSBrYeshytGZ+XT1VvOUpeIckiM1c8DeL3EXjJEJEcNOsAbm ULEot7jBMW8bpEPfDDbVAG6gmFK9YsmwdIkiEKFAqb8NzOoObCStJ7m96EZbEuuolRTa Yyew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=iVFrpCU85yQGmW5xbztUuh0IhAbViHt3uhfl+P214zU=; fh=m3oiE62fRN5J1XaE+5vpHZRIgCyFefxVI0mFw3d8yxA=; b=Eo5tzhxL8qyK6q3U+O8Cijb/ccxXTvLJeREwI/wV9QqrPuL4wWKG7TnDwrz+W9JESZ lcGYdgzTXU4MMDXgEs/wz+2FawcADAV+1yipvAavLMRZvopw78bowTnUQWBpNReu2nrt TiOPagjt9deGaNcdL6zOviNe6/6Y1mNlYNx/7kCPZHA+wQLrldxiFXA3gc+u8Y2a+2Xi qAgsoNW/a5Gv8xGnXUIEA59+TCbFjK5VM0OEEZJLqk4zdiUDxMLTZDEq6ukscZzH+MXc vbkflv4pU9YRTCyLOtftM1bgkThrUdqJy+/tPscLk79rP+hg4nz6AkNQQo+5gTYyt/Hv YTrA==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782307163; x=1782911963; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=iVFrpCU85yQGmW5xbztUuh0IhAbViHt3uhfl+P214zU=; b=q9nELJxrk4aojCEriLem/RZucd02/L9StUk7E9JXe3bzMbQAfK4ycuQWfGjj65tnlo wj9iW9apkZ1RZT8Hw5a4rSf23RkW2+keoReGL9B/6S7rNkHdG03s+GOqJRMqgfAG6T0z WLA75ZMrmTckapvxD4fDLJSf4ke2yJh/0O448o5h86WbyOJk2wsR2VAoQyjWcrUHy8QL TZPTxto76QUT7Pu+WaRpu6UZBUf/Z7YoNk3UoU8XQrbtSzc1FeQKAcShG0m+iGUE9hQn 7UxViXfhmvMK+MsSGYDzLiSfzbvLEY6C5oYf6mvnzMY8N2v1C1NsBJVMvz+vz3k+dpoX YJ7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782307163; x=1782911963; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=iVFrpCU85yQGmW5xbztUuh0IhAbViHt3uhfl+P214zU=; b=s4FWkikx/79FHyexQ0EGZD6DX1dTlVfhuYQJ6pn98DQb4GhgRwceApura5CUxy2Jbo wE5HVh+ORus4KlOND74hdx2QfQvWTYivmavtAjUPkPK7RuzyHEgz/f6aGvGJWrwEd0tc YEBozomdYopPoVcvgosLsRvjYaqT3UrvO9d4d2CkemonMqgUCOpwN9DtjOifNvIGTcKp y89tbCt/xoDDlSbrCps6ufvufAGviWSeHJo6lAJPHqUORZOWYP62BPVi6WjmFXNWwBzM GdVw5401ZNRs7KadYvBP5R+c6BBj3NvTEXqweJ3j8RnPYsQ7In7la9LPBhmP0LWwiA7H kIMw== X-Gm-Message-State: AOJu0YzCvr4jbsYrjzEmkjULb6yORDrD9Ha7xhVh5HCMZ9gjX468NN1Z GfDivQXWqaSYydHmQC9WbP/5AVhlW+d77bKOM6uQuXRjC9FfgQnYtUEjKgxIcAfYXgSq2nt5vB5 wKIBQSrXXz1WDCwm5+qxJ0xRfMQBc1w6AP6Na X-Gm-Gg: AfdE7ck608AFLShb/xi+sCspfM3XmgQDugAqevm4GUuIZn2mGXE1ISe+X145f+9KK+S TltsIm31KKQzpQfxatDMgLA9Mc7fXHQBVHXANt47mGTzy5hLZvXiB7AOZcEuLUho5CL/CtVCIzM HDi7doRcvB9sm53mctID92AYE4JHdPmHOhyJuB5tex3Zjyj/1DWnxcSMT5JA6JilqwX3B3xyQ9P cYRH3pYRPHAqNyU+AvBT1DSXyRGf1wgSaSXJM2A0B2TqY6B/SOed88wTUcuWctw1VMUfsQUJQ== X-Received: by 2002:a17:90b:4f8b:b0:368:341a:a925 with SMTP id 98e67ed59e1d1-37de46e004cmr3643284a91.23.1782307163166; Wed, 24 Jun 2026 06:19:23 -0700 (PDT) MIME-Version: 1.0 References: <20260608.103312.126925225500634683.ishii@postgresql.org> <20260623.215423.1556575793364415842.ishii@postgresql.org> In-Reply-To: <20260623.215423.1556575793364415842.ishii@postgresql.org> From: Emond Papegaaij Date: Wed, 24 Jun 2026 15:19:10 +0200 X-Gm-Features: AVVi8CeuDnCwNIdOzyK4qrmnFlPS7PYArdJfXXiJVkvBDl6_TOoeuuSuZffXwBQ Message-ID: Subject: Re: Fix signal handler in pgpool main To: Tatsuo Ishii Cc: pgpool-hackers@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thank you for taking care of this! I agree with your decision to not patch 4.3 given that the code doesn't match. You have to weigh the benefits against the risks in such cases. Best regards, Emond Op di 23 jun 2026 om 14:54 schreef Tatsuo Ishii : > > Hi Emond, > > > I got a bug report regarding pgpool main process from Emond Papegaaij: > > its exit/reload signal handler uses non signal safe functions, and it > > could lead to a crash of the process. > > > > Attached is the patch from him generated by Claude Code, with slight > > modifications by me. > > > > Basically it changes the signal handler to async-signal-safe calls > > only: capture the signal number into a new volatile sig_atomic_t > > main_exit_request, write one byte to the existing self-pipe to wake > > the main loop, restore errno, and return. The actual shutdown is > > performed synchronously by a new do_shutdown() function called from > > the pgpol main loop at the top of every iteration (via > > check_requests()) and also right after the inner pool_pause() returns, > > so a signal arriving during the 2-second select() sleep is acted on > > without an extra tick of latency. > > > > I think this patch is important and worth to apply to all supported > > branches. > > > > However, since it touches one of the most critical part of pgpool, I > > would like to apply to master branch first and see how our build-farm > > acts before back patching (it will take a few days). > > > > Comments? > > Patch pushed to v4.4. > > Peng and Koshino reviewed the patch off-list. No change was necessary. > I just removed some non-ASCII characters in comments (probably I > mistakenly brought them in by copy-and-paste). I tried to back-patch > to v4.3 but it seems it needs invasive changes and I gave up it. So I > decided to back patch through v4.4. > > Thank you! > -- > Tatsuo Ishii > SRA OSS K.K. > English: http://www.sraoss.co.jp/index_en/ > Japanese:http://www.sraoss.co.jp