Skip to content

SocketPool+ePoll: retry epoll_wait on EINTR - #223

Closed
lhoward wants to merge 1 commit into
swhitty:mainfrom
PADL:lhoward/epoll-wait-eintr-retry
Closed

SocketPool+ePoll: retry epoll_wait on EINTR#223
lhoward wants to merge 1 commit into
swhitty:mainfrom
PADL:lhoward/epoll-wait-eintr-retry

Conversation

@lhoward

@lhoward lhoward commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

epoll_wait returning -1/EINTR means a signal was delivered mid-wait; it is not an error. Treating it as fatal means any signal delivered to the process (attaching a debugger/strace, a timer, SIGCHLD, ...) tears down the whole server with epoll wait: Interrupted system call.

Retry the wait on EINTR instead.

errno/EINTR come from libc, which this file did not import (CSystemLinux only exports the epoll/eventfd headers), so import it alongside — matching the pattern already used in Socket.swift / SocketError.swift.

epoll_wait returning -1/EINTR means a signal was delivered mid-wait; it
is not an error. Treating it as fatal meant any signal (a debugger or
strace attach, a timer, SIGCHLD, ...) tore down the whole server with
"epoll wait: Interrupted system call". Retry the wait on EINTR instead.

errno / EINTR come from libc, which this file did not import (CSystemLinux
only exports the epoll/eventfd headers), so import it alongside.
@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.92%. Comparing base (0a6f327) to head (964c7dd).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #223   +/-   ##
=======================================
  Coverage   92.92%   92.92%           
=======================================
  Files          71       71           
  Lines        3719     3719           
=======================================
  Hits         3456     3456           
  Misses        263      263           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@swhitty

swhitty commented Jul 15, 2026

Copy link
Copy Markdown
Owner

nice, I've merged #224 which now conflicts here;

@lhoward

lhoward commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Ah ok will check.

@lhoward

lhoward commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Closing, this fix is no longer required

@lhoward lhoward closed this Jul 16, 2026
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.

2 participants