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 1ujglz-00AmZo-4j for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Aug 2025 16:13:51 +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 1ujglx-00Gm4X-Hh for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Aug 2025 16:13:49 +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 1ujglx-00Gm4P-7G for pgsql-hackers@lists.postgresql.org; Wed, 06 Aug 2025 16:13:49 +0000 Received: from mail-qv1-xf33.google.com ([2607:f8b0:4864:20::f33]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ujglu-0015lA-09 for pgsql-hackers@lists.postgresql.org; Wed, 06 Aug 2025 16:13:48 +0000 Received: by mail-qv1-xf33.google.com with SMTP id 6a1803df08f44-7074bad03ceso1261586d6.0 for ; Wed, 06 Aug 2025 09:13:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1754496824; x=1755101624; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=JZlmwFoPh7VitfUN1b0bvqmFMeOq1gkyXqNFK/3Banw=; b=FOc+pV30ht0PX7tJNMh8a4I5Wo0UbR3QAj6CZQe+xy2sf6bcLhly6GA5oye2KS6Lrw AhjKfEq5Hllx33QNCG77Q48PBP56t8Gh2Ri0HD950fdyB/DfLzkxxwuMj1MY7i8gqr0F WhjmHPniQ8cs7OT+aM2er4ixb02U5jsshJsj1dRcXLxCm6tburDZaZjhFi3AnBFW7sPT FOzKHRg2Zv6RulZUDcw5/6O/ui3JlFhZfjpTUMETryaruJFt0cjQFYJ8lXZLtbnFFcoF BcM69d0br9gxoK8lCnOq64TRPkOEE4QULi1VyvG5z6WbNIZ8/Q7nbQeoIXqTCOMBI0QX b4/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754496824; x=1755101624; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JZlmwFoPh7VitfUN1b0bvqmFMeOq1gkyXqNFK/3Banw=; b=rgKyPBaU1+vxRH64C+zZeC6pjg1Ch3ZvX0rPDOvG++btT4aGe9xaN2TVd4flvlV//Y D9RtiEZew1BH2Gc6ETLTk/t7C+D/SLwzXy77k6xeSlyTryWIEmIXb3o7ERe4d3gC7J6B S9N9IzpCxMFlAry/fWTPNbGt8G2uu0cR0B7darN8c6T57P3ANVI79xqMC471Yt6Y2mMe ptD4rNi0VR7kyUlq1ZxOQA7tutOwa9Q3eD/zUHXVR28lWzIX63MgMxXQqOf+Gta7NxvR giuFcyfEjzpxJhpn0p8xk8ZtL/2ggHiJT90MsTZlpNDyZtYanXfpIq4eMk5kePE0bMWa B+Sg== X-Gm-Message-State: AOJu0Yypc5Cx3zNo84smp67ZjAOLTlaWmfPXbb9U0U18vjmYhIAZhJjR zBqNY2uFrhbsg/4Fw+0hTa9jI3mCrGQGAPtzQB4f2mUKgKv1Ac3IDqOnnyrVNxChhDz/eNxn7A2 eNLZucsQUXuJGPaXvoTVsuqCesRapHXW4Ye6BFVpD X-Gm-Gg: ASbGnctG+ZV8yUMOa6vDnGMgImloCujJFk1geGCnALw+TplTsxje68OoZEYna59WInG kxHRy3BonwF1ETigs1fFyh7AxSZMXm5rRWSW382ehJ8atWa4eL+V6MDoqxvj1f5UtNKZTEBWfui 6Al2IXGmvdRQjxLI9owTNV7lRqJvGB0nJJLvmJV5J58ImQkdLGZB8v/FGt+64GEVrYoIn4pjP90 vGwTKw= X-Google-Smtp-Source: AGHT+IEjtfXGxb9jhDR2oesqCchATl5iVafk/3Ttj42xHyzmr+0Byq+JMMqCfWUKXNRXgskNmuoHBwiRnmEOjOY6/r8= X-Received: by 2002:ad4:5f4b:0:b0:705:227d:a511 with SMTP id 6a1803df08f44-709795f8797mr56613866d6.32.1754496823544; Wed, 06 Aug 2025 09:13:43 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jacob Champion Date: Wed, 6 Aug 2025 09:13:32 -0700 X-Gm-Features: Ac12FXxpND3oHLLZYAK-9q6Z3uAzstxR_-nzBSpuyXkQiGpeMI4gx5KhddGRjnQ Message-ID: Subject: Re: [PATCH] OAuth: fix performance bug with stuck multiplexer events To: Thomas Munro Cc: PostgreSQL Hackers , Daniel Gustafsson , Peter Eisentraut Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Aug 6, 2025 at 8:04=E2=80=AFAM Thomas Munro wrote: > * If it returns 1, then it stopped on the first level-triggered event > that it rechecked and found to be still true. Who cares if there are > more that didn't get rechecked? poll(fd) will report POLLIN either > way, and that's what you want. I think the weaker guarantee might be sufficient. I was trying to get a stronger primitive in place so that we wouldn't have to worry about it down the line, but it is a lot of code to pay... One sharp edge of that strategy is caught by the new tests, which is that if you call drain_socket_events() and then unset the timer, your multiplexer is still readable until you call drain_socket_events() yet again. At the moment, our code only ever calls those two in the opposite order (due to the race condition pointed out in 0002); we'd just have to keep that in mind. Maybe "drain" would no longer be the verb to use there. --Jacob