summaryrefslogtreecommitdiff
path: root/src/backend/port/dynloader/linux.h
diff options
context:
space:
mode:
authorJacob Champion <jchampion@postgresql.org>2025-08-08 08:44:37 -0700
committerJacob Champion <jchampion@postgresql.org>2025-08-08 08:44:37 -0700
commitff5b0824b3b0c58bbb322719628c42b7a4751dd9 (patch)
tree5579a658a7980ddd3a8c1990bf2409c4775127ee /src/backend/port/dynloader/linux.h
parentb5cd74612c26ec3f96dfe3689acd634db9385d2e (diff)
oauth: Remove stale events from the kqueue multiplexer
If a socket is added to the kqueue, becomes readable/writable, and subsequently becomes non-readable/writable again, the kqueue itself will remain readable until either the socket registration is removed, or the stale event is cleared via a call to kevent(). In many simple cases, Curl itself will remove the socket registration quickly, but in real-world usage, this is not guaranteed to happen. The kqueue can then remain stuck in a permanently readable state until the request ends, which results in pointless wakeups for the client and wasted CPU time. Implement comb_multiplexer() to call kevent() and unstick any stale events that would cause unnecessary callbacks. This is called right after drive_request(), before we return control to the client to wait. Suggested-by: Thomas Munro <thomas.munro@gmail.com> Co-authored-by: Thomas Munro <thomas.munro@gmail.com> Reviewed-by: Thomas Munro <thomas.munro@gmail.com> Backpatch-through: 18 Discussion: https://postgr.es/m/CAOYmi+nDZxJHaWj9_jRSyf8uMToCADAmOfJEggsKW-kY7aUwHA@mail.gmail.com
Diffstat (limited to 'src/backend/port/dynloader/linux.h')
0 files changed, 0 insertions, 0 deletions