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 1vxt1V-00HEI5-2r for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Mar 2026 20:40:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vxt1U-00EDpa-14 for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Mar 2026 20:40:48 +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.96) (envelope-from ) id 1vxt1T-00EDpS-2p for pgsql-hackers@lists.postgresql.org; Wed, 04 Mar 2026 20:40:48 +0000 Received: from mail-yw1-x112b.google.com ([2607:f8b0:4864:20::112b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vxt1R-00000000Qc1-2PsV for pgsql-hackers@postgresql.org; Wed, 04 Mar 2026 20:40:47 +0000 Received: by mail-yw1-x112b.google.com with SMTP id 00721157ae682-797ab169454so73013877b3.3 for ; Wed, 04 Mar 2026 12:40:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772656845; cv=none; d=google.com; s=arc-20240605; b=SqldvCWjLP3ihyOJbBB4vz3ioKl4P/GwXbF0e1JrBQAQ+PLX7qu/3kmt6+5+zjeyqI HkawHkqWlZqGT4slGc918opm+eTDNusR9nTJsXzntXX8iNv3Jyto6M92eSuHYbEVQmVW QL1NFlPmprZxDZqxLTp0iwDtDEr4FleRgs97ugUVz4CYZpxmn6NkhYSBnmlgUqLx+vgs 3VBzAZK43f+Ouxk6i1D89wNARobgYqkqjqSFktcoCHatKe9uJPJujcveKrfWHGTu6YbO t1vNS9iF7IRqLvWAJHTib9VmoKPy6j8hXv1FC4xypeX0DOXaEBQSFOKEFjztZKZtWVOe RfPQ== 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=8Hx0TiN3ncXaU1MTpezJPWYs15rkMlBtgkDNtWoaiBE=; fh=PjdhNf4ndT/hYYHPC4GNMEHU5bQdO2NsN2ewdx+zc0M=; b=CSliMesDYY00bNMQ0dMzIyLyuMcWKXzAQXkP1YxNq+S4eMdRSqlIgyT2oTtAgxO/mQ 1UlDudHLVZ17+/F7IU3adQTng+TzESLMJKVuXsD3jXcZtZ5/MLhHrQq/GbUwV7ynGm4r K3z/BarqV90awyfciKufyJgCwzJ2DzKjX/JQN1eFxXRAEq6A2js4XbbjyGoHbBhuDMzs xrcLrq9R3Uk8A+83ZvJPgFSH5A/P0Xj/oW+ZMmwFZ8v+oBOWMzbVmfqlhN+ByrGuV8P/ WR7aIiKmm2cCWKNzxqYA9dXJ8YrTy9oBpaaIit17BRGNkqDPSlcfOHbYf94mvATO7gWW KnPQ==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=percona.com; s=google; t=1772656845; x=1773261645; darn=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=8Hx0TiN3ncXaU1MTpezJPWYs15rkMlBtgkDNtWoaiBE=; b=aS3zcz2pgGXqdS1UnO/bqmfNBT2IA/6LcCdN+g2Sbj2++0HGUP+R67dT0a5XWrfyQ2 tE3EfFAX8PQjZl8fqn5IAnK+5+tot1uwqH8yToLr/EzVZPctTzXtrrkxPmRiLEvAeNob mAJdUvEGkQSx8uzdQ0fDsWbcPzjFIItoIpVnM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772656845; x=1773261645; 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=8Hx0TiN3ncXaU1MTpezJPWYs15rkMlBtgkDNtWoaiBE=; b=pzAEWYgXJBSVHO2Osucr/nWuwE9FFmWXKwFDUgoXtfynFS7LVFEDjBgGEaCc8KIkTn VOYJlTaMzSZA+kCnudMQiid8rh5xneOlBykuILD7ORPC6VwpE/eaULJVaBxTW7QQnQe+ BkpSDenAZsoVh5LLBPzpp2iQio24cYiMJ9AR9VDKgFvTfkKowm1H8TcLvJFn1vgb+eIx DIvDzSDXzuP/hHQ3S6rKWBJej+kTmcOe0mESsodDWUDQ2XJfN7IxuJLojoZyERa5RX6L 78QlX5RpJxItQ9xpxIX9W0CqujXRq+2nd2l3ptDvx8M4dgGAkRmArXBQPY2KxJblXFr1 9V0A== X-Forwarded-Encrypted: i=1; AJvYcCXw8CusMmBa+nLjBEf7/DbnXtEwJU7kOJkYUFNKL+A6skHtf+g7Ph0qFhEm/qGHYM9G9YSBaF7aQN6xppSO@postgresql.org X-Gm-Message-State: AOJu0YzZkOAJfe7RDBYe1JEBXzJ90NecORBZKYHs+x8A/MY5Y0zAHkR2 ptWFWdpCHAr5sJhDjoVKmqpz6sFMOuzJneIrYI1d07EjWxaxw8Q/OlBRNxSqbZvYVJpKzLR9y/Z z4eR2/A7FBEDiLuKOghRonbIzdqfGGc2vqijsVWUYN+wX0MCdTI1yBj1gbm9+/zJhSDB9XjBoB4 XqyfnYYg6/JCsrhBtd1mKEPOiPz9pKk9vUZ3tLvfVlpetNE6Yc9sJtX0KCVIfe4vmHi8Dik5SAe MRJLGeXX31Yl3lRf7m2IFYWW6iAgPaLdlyDCtmYmExXdXM5FzQ= X-Gm-Gg: ATEYQzxDEZFwDvZBHFFdCerknHBwjKAD6Uu2b0GjeOUSk7K6OeBYnH/yAomLKPCEARe hmnEe9BNXCBonWaGRNG6TcehjO0T+baVLKRkUPm4/XE87fRcNQ3Xui1msJ9KbDVWWG7XPu2lrcp ZI3kDjZl9SEd9RnQAn1qlfr2Xd//hOBU1wK/TvH9dkJCAer96/JZ7TSBdVLzKrJF/hnaD5+OCN0 y3Kzmxuwepwx18rMOzHnufpkj8/634q+YQjaPMMGzITcUcOnZMxd/9W4h36ClspSLzUeTd6gb/x BGcBnlegSk+BMv/zWeNAXht7wYdUX2zDcHFH2xgzx2HjPo0FnqWQMfrgz5EU27glLgOf X-Received: by 2002:a05:690c:112:b0:796:39c2:bccb with SMTP id 00721157ae682-798c6d153demr26590057b3.63.1772656844731; Wed, 04 Mar 2026 12:40:44 -0800 (PST) MIME-Version: 1.0 References: <7DB528BA-C7A0-4B23-890C-5332FB35A16E@yesql.se> <7094F798-8DD1-4974-9A04-10E147B29581@gmail.com> <15434512-B3FB-4AB3-B6B3-5D85ED0B4BBE@yandex-team.ru> In-Reply-To: From: Zsolt Parragi Date: Wed, 4 Mar 2026 20:40:34 +0000 X-Gm-Features: AaiRm52hh_ZRqguf3QstN3VQvZHaXQSAxhq6ACyVV2KwLI1u7TVVHDd9pOMPDIM Message-ID: Subject: Re: Improve OAuth discovery logging To: Jacob Champion Cc: Andrey Borodin , Chao Li , Daniel Gustafsson , PostgreSQL Hackers , Michael Paquier Content-Type: text/plain; charset="UTF-8" X-CLOUD-SEC-AV-Sent: true X-CLOUD-SEC-AV-Info: percona,google_mail,monitor X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > Cirrus seems to have noticed an intermittent failure [1]; what's that about? Looks like we have some out of order logging, because of the multiple backends involved. DISCOVERY 2026-02-27 20:11:12.104 UTC postmaster[43175] DEBUG: forked new client backend, pid=43267 socket=7 DISCOVERY 2026-02-27 20:11:12.118 UTC client backend[43267] [unknown] LOG: connection received: host=[local] 2026-02-27 20:11:12.179 UTC postmaster[43175] DEBUG: assigned pm child slot 3 for client backend 2026-02-27 20:11:12.179 UTC postmaster[43175] DEBUG: forked new client backend, pid=43281 socket=7 LOGIN 2026-02-27 20:11:12.179 UTC client backend[43281] [unknown] LOG: connection received: host=[local] LOGIN 2026-02-27 20:11:12.180 UTC client backend[43281] [unknown] LOG: oauth_validator: token="9243959234", role="test" LOGIN 2026-02-27 20:11:12.180 UTC client backend[43281] [unknown] LOG: oauth_validator: issuer="http://127.0.0.1:44122", scope="openid postgres" LOGIN 2026-02-27 20:11:12.180 UTC client backend[43281] [unknown] LOG: connection authenticated: identity="test" method=oauth (/tmp/cirrus-ci-build/build/testrun/oauth_validator/001_server/data/t_001_server_primary_data/pgdata/pg_hba.conf:2) LOGIN 2026-02-27 20:11:12.180 UTC client backend[43281] [unknown] LOG: connection authorized: user=test database=postgres application_name=001_server.pl LOGIN 2026-02-27 20:11:12.180 UTC client backend[43281] 001_server.pl LOG: connection ready: setup total=1.804 ms, fork=0.424 ms, authentication=0.287 ms LOGIN 2026-02-27 20:11:12.181 UTC client backend[43281] 001_server.pl LOG: statement: SELECT $$connected with user=test dbname=postgres oauth_issuer=http://127.0.0.1:44122 oauth_client_id=f02c6361-0635$$ ... we read the log around this part ... DISCOVERY 2026-02-27 20:11:12.189 UTC client backend[43267] [unknown] DEBUG: OAuth issuer discovery requested 2026-02-27 20:11:12.190 UTC postmaster[43175] DEBUG: releasing pm child slot 1 DISCOVERY 2026-02-27 20:11:12.190 UTC postmaster[43175] DEBUG: client backend (PID 43267) exited with exit code 0 So it's a scheduling issue, since we log the "oauth discovery requested" after we already sent the issuer info to the client, so the other connection attempt can already be in progress (at least with simple setups like this test) Also related that connect_fails uses wait_for_log, noticing log messages that appear later, while connect_ok simply checks the logs at that moment. I'm not sure which solution is better for this: removing the check for this message from the test or modifying connect_ok to wait for all backends that started since the connection attempt to finish? Modifying it seems the better choice to me, but that is also a separate change.