cloudant/rexi — pull request #18 by kocolosk (2013-10-16 16:02:19+00:00)
Title: Rework RPC governors

This PR changes the governors in a few important ways:

* No local processes are spawned to send messages,
* Governors buffer messages internally and attempt to send one message (per remote node) at a time,
* Governors decide to drop messages based on the total memory consumption of the local node,
* Governors send buffered messages in a LIFO fashion instead of FIFO,
* Governors are registered using identifiable names a la the per-node `rexi_servers`,
* All of the logic in the `gov_manager` is obsolete or is being removed (e.g. the nodeout bits)

The `server_mon` is also tweaked to start per-node servers immediately after booting.

The upgrade can get tricky as with any change that adjusts supervision trees. The changes to the governor will cause the existing governors linked to the `gov_manager` to crash ~immediately. We're modifying `rexi_sup` to not restart the `gov_manager` when it does crash, so hopefully that works out. The `server_mon` process should upgrade state correctly via `code_change`.

A future improvement would be to leverage `memsup` and allow custom thresholds for when to drop messages on the floor (e.g. when the `system_memory_high_watermark` is reached).

BugzID: 23717
BugzID: 23718