-
Notifications
You must be signed in to change notification settings - Fork 630
Daemonising inside an event loop causes hangs #569
Description
Unfortunately the latest eventmachine release has broken mailcatcher.
With eventmachine 1.0.4, if you install the latest mailcatcher with gem install mailcatcher -v "0.5.9" then start it with mailcatcher _0.5.9_ then nc localhost 1025 you won't get a welcome message, and the process won't respond to SIGTERM. (There's a workaround in 0.6.0.)
Mailcatcher starts an eventmachine loop and binds to a couple of ports before daemonising so we can display messages back to the user if anything fails. Previously this worked fine, and if you run without daemonisation it still works fine, but when daemonising the smtp server stops working. (Thin continues working fine, however).
Some bisecting revealed 10deb49 to be the guilty commit. Not sure exactly how it's interacting to cause SMTP to fail but not Thin.
I assume this is because daemonising will fork, twice, and that is tripping up the pid change handling.