redding/sanford — pull request #118 by jcredding (2014-06-20 20:20:05+00:00)
Title: Switch to testing the new `Server`, remove the old `Server`

This switches the test suite over to testing the new `Server`
and removes `ServerOld`, `WorkerOld` and all the testing
that went with them. This reworks the recipient handling system
tests as server system tests and runs them against the new server
logic. This ensures that the new server should handle requests
like the old one did.

This puts in a hack to get the new server logic working with the
existing CLI/manager logic. It builds an anonymous service class,
using the host configuration for the servers configuration. This
works, but is not going to be the way this is handled going
forward. This is temporary so the bench scripts can be run and
so we don't have Sanford in a broken state.

Finally, I found a "bug" that I believe was introduced with the
latest DatTCP (v0.5). I found that after hot restarting, I would
get a random `SignalException: SIGALRM` that would cause the
process to exit. I found this is a "bug" with the manager
implementation of restarting. The problem is the manager runs all
the restart logic in the trap for the restart signal, which is a
bad practice. Because DatTCP pauses so quickly, the original
thread for the server doesn't get to exit appropriately before
we run `exec` and replace the process. This seemed to cause the
`SIGALRM`. I found that if I just turned on DatTCP logging, which
should slightly slow it down when being paused, the issue would
go away. To handle this, I patched the restart logic to join the
server thread and make sure it exits before calling `exec`. This
cleared up the problem and confirmed my suspicions that the
thread was not properly exiting.

@kellyredding - Ready for review.