brettwooldridge / NuProcess

Low-overhead, non-blocking I/O, external Process implementation for Java
Apache License 2.0
710 stars 84 forks source link

Handle EINTR during epoll_wait. #125

Closed bturner closed 2 years ago

bturner commented 3 years ago

epoll_wait is not restarted after it's interrupted by a signal handler, even if the handler used SA_RESTART. Instead, the calling code needs to handle the EINTR and restart the call itself.

Fixes #124

bturner commented 3 years ago

Seems like the CI bits aren't really running anymore. I don't see the ARM and x64 checks that other pull requests have had.

We were able to get a reproduction of EINTR by attaching strace to the JVM while it's in epoll_wait. Without this patch, an exception is thrown and the process is leaked. With it, processing continues normally.

bturner commented 3 years ago

I see 2.0.2 was released without this. Any chance of a merge and a 2.0.3?

bturner commented 3 years ago

We've found another path that can result in zombies. I'll either update this pull request or open a second one.