Remove EventMachine from Health Monitor and the Director #2502
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is this change about?
The eventmachine gem is no longer receiving updates. This commit moves
asynchronous functionality of bosh-monitor / Health Monitor to use the
async gem (and associated ecosystem) instead.
wrapped in async blocks.
appear to be an analog in the async gem
Please provide contextual information.
Previous PRs removing other instances of EventMachine: #2497, #2499, #2500
What tests have you run against this PR?
Overall tests:
Plugins:
Very notably, several individual Health Monitor plugins have not been verified to work. The biggest risk plugins seem to be Email, Graphite, and TSDB, as they required the most rewrites due to high coupling with EventMachine. Email and Graphite have received some very basic manual tests.
Does this PR introduce a breaking change?
Not necessarily a breaking change, but the
em_threadpool_size
config option for Health Monitor has been removed with no analogous configuration option added. EventMachine seems to have created a fixed-size thread pool to run its event loop whereas the async gem uses Ruby fibers.This does mean there may be a slight risk in certain places in the code of spawning many async tasks simultaneously that would have been previously limited by the size of the EventMachine thread pool; in those places, I've added a semaphore to limit the number of simultaneous tasks.