0002-oauth-Improve-validator-docs-on-interruptibility.patch
application/octet-stream
Filename: 0002-oauth-Improve-validator-docs-on-interruptibility.patch
Type: application/octet-stream
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch 0002
Subject: oauth: Improve validator docs on interruptibility
| File | + | − |
|---|---|---|
| doc/src/sgml/oauth-validators.sgml | 7 | 5 |
From aca624e05b9b0c46f1f6a17c66af02e71c201dab Mon Sep 17 00:00:00 2001
From: Jacob Champion <jacob.champion@enterprisedb.com>
Date: Tue, 25 Feb 2025 07:42:43 -0800
Subject: [PATCH 2/3] oauth: Improve validator docs on interruptibility
Andres pointed out that EINTR handling is inadequate for real-world use
cases. Direct module writers to our wait APIs instead.
Discussion: https://postgr.es/m/p4bd7mn6dxr2zdak74abocyltpfdxif4pxqzixqpxpetjwt34h%40qc6jgfmoddvq
---
doc/src/sgml/oauth-validators.sgml | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/doc/src/sgml/oauth-validators.sgml b/doc/src/sgml/oauth-validators.sgml
index 356f11d3bd8..704089dd7b3 100644
--- a/doc/src/sgml/oauth-validators.sgml
+++ b/doc/src/sgml/oauth-validators.sgml
@@ -209,11 +209,13 @@
<para>
Modules must remain interruptible by signals so that the server can
correctly handle authentication timeouts and shutdown signals from
- <application>pg_ctl</application>. For example, a module receiving
- <symbol>EINTR</symbol>/<symbol>EAGAIN</symbol> from a blocking call
- should call <function>CHECK_FOR_INTERRUPTS()</function> before retrying.
- The same should be done during any long-running loops. Failure to follow
- this guidance may result in unresponsive backend sessions.
+ <application>pg_ctl</application>. For example, blocking calls on sockets
+ should generally be replaced with code that handles both socket events
+ and interrupts without races (see <function>WaitLatchOrSocket()</function>,
+ <function>WaitEventSetWait()</function>, et al), and long-running loops
+ should periodically call <function>CHECK_FOR_INTERRUPTS()</function>.
+ Failure to follow this guidance may result in unresponsive backend
+ sessions.
</para>
</listitem>
</varlistentry>
--
2.34.1