2010-09-03

2010-09-03 08:41 pm

EventMachine

This is probably only of interest to perhaps three of you, but what the heck.

I discovered today that EventMachine, a very commonly used Ruby library, has a completely broken popen implementation. Specifically, it doesn't ever call waitpid unless you are

  • Running on Linux and have selected the epoll option
  • or the process closes all of its input sockets.
In practice this means that if your subprocess spawns a background process and exits, EventMachine will not notify you of that process exiting until the subprocess dies too.

Lost a couple hours to this. It is in no way atypical of either EventMachine or Ruby, sadly.