Skip to content

Commit 873c0fd

Browse files
committed
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. Author: Jacob Champion <jacob.champion@enterprisedb.com> Discussion: https://postgr.es/m/p4bd7mn6dxr2zdak74abocyltpfdxif4pxqzixqpxpetjwt34h%40qc6jgfmoddvq
1 parent d7e4084 commit 873c0fd

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

doc/src/sgml/oauth-validators.sgml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,13 @@
209209
<para>
210210
Modules must remain interruptible by signals so that the server can
211211
correctly handle authentication timeouts and shutdown signals from
212-
<application>pg_ctl</application>. For example, a module receiving
213-
<symbol>EINTR</symbol>/<symbol>EAGAIN</symbol> from a blocking call
214-
should call <function>CHECK_FOR_INTERRUPTS()</function> before retrying.
215-
The same should be done during any long-running loops. Failure to follow
216-
this guidance may result in unresponsive backend sessions.
212+
<application>pg_ctl</application>. For example, blocking calls on sockets
213+
should generally be replaced with code that handles both socket events
214+
and interrupts without races (see <function>WaitLatchOrSocket()</function>,
215+
<function>WaitEventSetWait()</function>, et al), and long-running loops
216+
should periodically call <function>CHECK_FOR_INTERRUPTS()</function>.
217+
Failure to follow this guidance may result in unresponsive backend
218+
sessions.
217219
</para>
218220
</listitem>
219221
</varlistentry>

0 commit comments

Comments
 (0)