Open
Conversation
ljharb
approved these changes
Oct 22, 2018
src/heartbeat.js
Outdated
| this.emit('workerStall', workerId); | ||
| this.emit('info:workerHeartbeatDelta', workerId, delta); | ||
| .filter(([, worker]) => !worker.isDead()) | ||
| .filter(([, worker]) => worker.state === 'up').forEach(([workerId]) => { |
Collaborator
There was a problem hiding this comment.
sinc the filters are on their own lines, the forEach should be too
andyfangdz
approved these changes
Oct 22, 2018
Collaborator
andyfangdz
left a comment
There was a problem hiding this comment.
Changes look good to me. Thanks for doing this!
It looks like we now won’t be detecting stalls that are caused by process startup. This is reasonable as time to first heartbeat should be treated separately. Perhaps a future task 😄
Collaborator
Author
|
@andyfangdz yes, though I think we already weren't adequately tracking that due to monitoring only starting after all workers came up for the first time. Monitoring successful boot and start up time is def a useful, but distinct thing. |
When the process backing a worker exits, pool-hall replaces it with a new process. Process start up can take a nontrivial amount of time. The heartbeat module was not aware of process replacement, so it continued expecting heartbeats while the process was starting up. This can lead to a worker being reported as stalled, when it merely booting up, leading to confusion over underlying problem (stalls = infinite loops, process replacement = unhandled errors or the like). This factors in worker state to monitoring and tweaks delta checking to avoid reporting start up time.
253a1e6 to
45aa881
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When the process backing a worker exits, pool-hall replaces it with a
new process. Process start up can take a nontrivial amount of time.
The heartbeat module was not aware of process replacement, so it
continued expecting heartbeats while the process was starting up. This
can lead to a worker being reported as stalled, when it merely booting
up, leading to confusion over underlying problem (stalls = infinite
loops, process replacement = unhandled errors or the like).
This factors in worker state to monitoring and tweaks delta checking to
avoid reporting start up time.
/cc @andyfangdz @goatslacker @martinwin