toland / patron

Ruby HTTP client based on libcurl
http://toland.github.com/patron/
MIT License
541 stars 74 forks source link

Better monitoring of forked Puma processes #188

Closed marshall-lee closed 2 years ago

marshall-lee commented 2 years ago

3d3d5b3 introduced running Puma processes as child forks.

The fix was necessary but it doesn't monitor the process state properly.

What if after(:suite) block is not executed at all and child process becomes a zombie? What if fork process refuses to exit for some reason?

So I have introduced a Fork helper that tries to prevent forks from becoming a zombie by sending it SIGKILL if SIGTERM didn't have an effect in 500ms or when Ruby interpreter terminates completely (at_exit).