Cluster fixes - #789
Conversation
|
This changes unreleased API modifications for AggregatorRegistry, so this will need to be part of v0.16. Also fixes a memory leak in trunk for broadcastchannels, and improves lifecycle management for dead worker threads (both kinds) |
| return { threadId, channel }; | ||
| }); | ||
|
|
||
| await delay(5); // Let announcements arrive |
There was a problem hiding this comment.
Just speaking from past experience, this seems like it could become a flaky test in the future (on slow CI machines).
There was a problem hiding this comment.
I'll check if there's callback.
There was a problem hiding this comment.
This test already includes delay(), btw.
There was a problem hiding this comment.
No callback. Might be stuck with this one.
| .then(metrics => Registry.aggregate(metrics.flat()).metrics()) | ||
| .then(result => done(undefined, result), done); | ||
| const myMetrics = Promise.all( | ||
| registries.map(async r => r.getMetricsAsJSON()), |
There was a problem hiding this comment.
It looks like you do something similar in a couple other places in this PR, and those places don't add the extra async to the map callback.
In particular, cluster now uses a similar announcement system to filter workers. This fixes prometheus#181.
Caught by jest warnings.
Signed-off-by: Jason Marshall <jdmarshall@users.noreply.github.com>
Signed-off-by: alencristen <299997878+alencristen@users.noreply.github.com>
99.9% of the time process.send() is going to work. We don't need to guard it when it's already inside of a try block. Just guard the retry send. Also reduces the amount of excessive mocking going on in the tests by using jest more instead of creating our own mocks. Signed-off-by: Jason Marshall <jdmarshall@users.noreply.github.com>
cjihrig
left a comment
There was a problem hiding this comment.
LGTM, but there are a couple linter issues in lib/worker.js.
Rework of worker and cluster lifecycle management. Also allows the primary cluster thread to report stats, adds debug information to common possible failure paths.
Fixes #155, #181, #183, #280, #501, #563, #788