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 1uk55G-00FUYw-Da for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Aug 2025 18:11:22 +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 1uk55E-008VI9-2X for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Aug 2025 18:11:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uk55D-008VFo-MW for pgsql-hackers@lists.postgresql.org; Thu, 07 Aug 2025 18:11:19 +0000 Received: from mail-qv1-xf31.google.com ([2607:f8b0:4864:20::f31]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uk558-001GEN-1z for pgsql-hackers@lists.postgresql.org; Thu, 07 Aug 2025 18:11:17 +0000 Received: by mail-qv1-xf31.google.com with SMTP id 6a1803df08f44-7077a1563b5so12502636d6.1 for ; Thu, 07 Aug 2025 11:11:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1754590274; x=1755195074; 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=wkfpwMm+jpJdEHES+pUaD6neRgDpaQBdLjZ6jAFhK0I=; b=boh+r6M7LL20+gwyB9EtZQJoa10V3UFFKux5/qDHr08bJPevNobtQO91H086Kr9MLK dKDI8GGGqNL4WIDq6VDikN0vQi7StLWWCjqCtZWhDplBb6irHLbqB6dtYh/kGbKIrunc eTz0QdbKGjBK8bk62gkj8fQQbyzRGFNP9CFDnpTRVm5tYKOcQXtzg7Z/mR+G229urE/H ksdPirQco0syEWzdc9a6CQQXxg2revg+DFe3cuwut7qdM8bGDrgpUEyW0uwhT7Al8jdB cXIF28EOlC1oznWuaKDL7B5Acd2x1kzmQDSEW9960FuMIqklugGpKmpU1qSIWYKjmI6K 8F/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754590274; x=1755195074; 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=wkfpwMm+jpJdEHES+pUaD6neRgDpaQBdLjZ6jAFhK0I=; b=aKLUV5MKuO0FKTSEBzem9I6GIFXfMjwwJ/uPZH2kCP0BtJWYOe+5nYNjB8Slt3d3PL pPLshdpicWzvcAFqW26yYVBakDwqYorYzSjmMFHt8xkbt1g6/cFd0WDVhWfNZasiOoZC +lvkyyxqdsWpj5d4+tvsY17Ko6qOwAPUcusHva9StlBygGN65z1ra6alcqFxQgKQQPRX uSdzxWs+oMj6kubkQ7FxXbTATB5rUsCKUXFwTV/7CqHSWgWDi/JoBfVgS+ds8zcP6mAY Kh8YdGzO4ZmZapiklgkMiB/qtdk4lORuPdXxrzfv9igtcU6uN8XSnv1QuogyC+l3vBrO J9CQ== X-Gm-Message-State: AOJu0YzReLuXZAbftnnaYdgjG5MgfMjMgBBp7tP/iY9ysQ6oQfrW0N6T Lxm2woAITd+OY5MB3eVckAtoQqNeoDK0+uPACEas0YLMVqQBYm1Mg16QGsFz4H9XE93HicQNrnP 79Ai2D0y0kX1M5F/QPPtE11A4pF6dJHevBb+jXFjL X-Gm-Gg: ASbGncuJ/bqoMqh7LqOFXMKVcy1SAitHH8ZQuSaPDGWHQOF5hR0+e26jNNiF82zt+v9 B8JYGVzaLJYQ6OXhVWOuNXscHO9naO8W8LHGFlaPBzgotcZkBtJGImPF2aMvsNPa2BfN2WbxTD6 yBTj5t19om7CSf6H/dZk0H5sBkcrciqBPLE07+wDYwPWIUCXhYFrA7sQu1wRM7geIap8Jumdo/X guOxbs= X-Google-Smtp-Source: AGHT+IHu1+fsmRXvJ7igANbzpTJj7EugmGrcIDbYPkqaKctGlhvawid/UfHJOOHFkBdlNl+YEj2MFSSAvgEnAGohj+s= X-Received: by 2002:a05:6214:2b09:b0:709:23f0:f48 with SMTP id 6a1803df08f44-7099a30126fmr3845286d6.15.1754590274364; Thu, 07 Aug 2025 11:11:14 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jacob Champion Date: Thu, 7 Aug 2025 11:11:02 -0700 X-Gm-Features: Ac12FXxzdcFY--9Iz7RfZRRb38EUScqPUhmKuQzIBxmUVXP-8c8Ox5eTXsPZEuQ 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 6:46=E2=80=AFPM Thomas Munro wrote: > "Unlike epoll descriptors, kqueue descriptors only transition from > readable to unreadable when kevent() is called and finds nothing, > after removing level-triggered conditions that have gone away. We > therefore need a dummy kevent() call after operations might have been > performed on the monitored sockets or timer_fd. Any event returned is > ignored here, but it also remains queued (being level-triggered) and > leaves the descriptor readable. This is a no-op for epoll > descriptors." I really like this; I'm working it into the doc comment. > FWIW I re-read the kqueue paper's discussion of the goals of making > kqueue descriptors themselves monitorable/pollable, and it seems it > was mainly intended for hierarchies of kqueues, like your timer_fd, > with the specific aim of expressing priorities. It doesn't talk about > giving them to code that doesn't know it has a kqueue fd (the client) > and never calls kevent() and infers the events instead (libcurl). Interesting! It would be nice if they papered over this for us, but I guess that's water under the bridge. > s/signalled/signaled/ (=3D US spelling) in a couple of places. Ah. Will fix(?) or else lobby the dictionary companies. Thank you so much for the reviews! --Jacob