cloudant/rexi — pull request #5 by bdionne (2012-11-29 14:38:42+00:00)
Title: Manage excessive amount of spawned pids

rexi_utils:send uses the noconnect and nosuspend options to immediately
return to the controller and spawns new processes to send the messages, assuming
the remote node is only temporarily down. In the nosuspend case these pids
can hang around indefinitely and build up.

This patch handles the noconnect and nosuspend cases separately. In the noconnect
case it sends a rexi_DOWN message immediately to the controller. In the nosuspend case
it spawns but also adds the new pid to a list kept on the process heap. When the controllers
are finished a call to rexi_monitor:stop is made as these messages are monitored. At that
point any spawned pids are killed.

BugzID: 15608