Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.4k
cluster: guard against undefined message handlers#6902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Conversation
santigimeno commented May 20, 2016
What about adding a test based on the code from #6561 (comment)? |
cjihrig commented May 20, 2016
@santigimeno I could definitely do that. I wasn't sure if relying on undefined behavior (doing async things in the |
santigimeno commented May 20, 2016
@cjihrig I understand. You're probably right. |
santigimeno commented May 20, 2016
Sorry, I meant, the worker is receiving the same message twice: |
santigimeno commented May 20, 2016
@cjihrig I've tried a different fix: santigimeno@7dae5d7. Not too sure about it. What do you think? |
cjihrig commented May 20, 2016
@santigimeno I was just commenting. The problem, as your solution shows, is that the IPC channel doesn't get a chance to consume anything. I found the problem by adding a |
santigimeno commented May 20, 2016
Agreed Something interesting: changing the scheduling policy to |
cjihrig commented May 20, 2016
@santigimeno I opened #6909 as an alternative/complementary idea for this. I solved it in |
c6c4c2a to 4a64666Comparecjihrig commented May 23, 2016
@santigimeno I came up with a test for this one. It fails for me before this change, and passes after. PTAL |
santigimeno commented May 23, 2016
cjihrig commented May 23, 2016
I definitely see where you're coming from with that comment, but I also think it would be good to make the code a little more robust. @bnoordhuis thoughts? |
bnoordhuis commented May 25, 2016
The change looks alright to me. LGTM. |
cjihrig commented May 25, 2016
cjihrig commented May 25, 2016
CI was green minus what appears to be a Jenkins hiccup on ARM. |
cluster's internal message handling includes a cache of callback functions. Once the message for that callback is received, it is removed from the cache. If, for any reason, the same message ID is processed twice, the callback will be missing from the cache and cluster will try to call undefined as a function. This commit guards against this scenario. Refs: nodejs#6561 PR-URL: nodejs#6902 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]>
cluster's internal message handling includes a cache of callback functions. Once the message for that callback is received, it is removed from the cache. If, for any reason, the same message ID is processed twice, the callback will be missing from the cache and cluster will try to call undefined as a function. This commit guards against this scenario. Refs: nodejs#6561 PR-URL: nodejs#6902 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]>
cluster's internal message handling includes a cache of callback functions. Once the message for that callback is received, it is removed from the cache. If, for any reason, the same message ID is processed twice, the callback will be missing from the cache and cluster will try to call undefined as a function. This commit guards against this scenario. Refs: #6561 PR-URL: #6902 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]>
MylesBorins commented Jul 1, 2016
@cjihrig lts? |
cjihrig commented Jul 5, 2016
Yes, please. |
cluster's internal message handling includes a cache of callback functions. Once the message for that callback is received, it is removed from the cache. If, for any reason, the same message ID is processed twice, the callback will be missing from the cache and cluster will try to call undefined as a function. This commit guards against this scenario. Refs: #6561 PR-URL: #6902 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]>
cluster's internal message handling includes a cache of callback functions. Once the message for that callback is received, it is removed from the cache. If, for any reason, the same message ID is processed twice, the callback will be missing from the cache and cluster will try to call undefined as a function. This commit guards against this scenario. Refs: #6561 PR-URL: #6902 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]>
cluster's internal message handling includes a cache of callback functions. Once the message for that callback is received, it is removed from the cache. If, for any reason, the same message ID is processed twice, the callback will be missing from the cache and cluster will try to call undefined as a function. This commit guards against this scenario. Refs: #6561 PR-URL: #6902 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]>
cluster's internal message handling includes a cache of callback functions. Once the message for that callback is received, it is removed from the cache. If, for any reason, the same message ID is processed twice, the callback will be missing from the cache and cluster will try to call undefined as a function. This commit guards against this scenario. Refs: #6561 PR-URL: #6902 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]>
cluster's internal message handling includes a cache of callback functions. Once the message for that callback is received, it is removed from the cache. If, for any reason, the same message ID is processed twice, the callback will be missing from the cache and cluster will try to call undefined as a function. This commit guards against this scenario. Refs: #6561 PR-URL: #6902 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]>
Checklist
Affected core subsystem(s)
cluster
Description of change
cluster's internal message handling includes a cache of callback functions. Once the message for that callback is received, it is removed from the cache. If, for any reason, the same message ID is processed twice, the callback will be missing from the cache andclusterwill try to callundefinedas a function. This commit guards against this scenario.Fixes#6561