Skip to content

Wake JS on libuv poll errors instead of dropping the callback - #137

Open
nigrosimone wants to merge 1 commit into
brianc:masterfrom
nigrosimone:fix-poll-error
Open

Wake JS on libuv poll errors instead of dropping the callback#137
nigrosimone wants to merge 1 commit into
brianc:masterfrom
nigrosimone:fix-poll-error

Conversation

@nigrosimone

@nigrosimone nigrosimone commented Aug 9, 2026

Copy link
Copy Markdown

on_io_readable and on_io_writable look only at revents. But libuv signals a poll error with
status < 0 and revents == 0, and before calling the callback it already runs uv__io_stop and
uv__handle_stop, so the fd is out of the loop and no other event can arrive.

The result is that a connection reset by the peer becomes silent while it still looks alive.

I found it with pipelined queries in pg-native, where losing a backend in the middle of a batch left
the client with a connection that never completes and never fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant