Uh oh!
There was an error while loading. Please reload this page.
cluster: wait for all servers closing before disconnect - #1400
Conversation
Olegas
commented
Apr 11, 2015
/cc @bnoordhuis |
There was a problem hiding this comment.
Could you change 127.0.0.1 to common.localhostIPv4?
Olegas
commented
Apr 11, 2015
@brendanashworth done |
There was a problem hiding this comment.
Can you please use a more descriptive name. Maybe checkRemainingHandles.
Olegas
commented
Apr 13, 2015
@cjihrig tests are the same, except scheduling policy. But there are note in the |
Fishrock123
commented
May 21, 2015
@cjihrig is this (still?) lgty? |
cjihrig
commented
May 30, 2015
@Fishrock123 the code changes themselves look good to me. I don't love the tests. Seems like a single test should be adequate, and it would be nice to simplify the test a bit if possible. |
Olegas
commented
May 31, 2015
@cjihrig I think two tests are required to ensure both scheduling policies are working correct. |
cjihrig
commented
Jun 1, 2015
I don't think the code being tested here is really reliant on the scheduling policy. Granted, the |
sam-github
commented
Jun 2, 2015
fwiw, I agree with @cjihrig about the tests. As far as this change goes, it looks OK to me, though I haven't run or tested it. In particular, it looks like the ProgressTracker was lost in the cluster rewrite: https://github.com/joyent/node/blob/v0.10.38-release/lib/cluster.js#L520-L528, and this PR brings something like it back. |
Olegas
commented
Jun 2, 2015
@sam-github@cjihrig now there are only one test. If it is ok now I'll do rebase/squash to a single commit. |
sam-github
commented
Jun 2, 2015
Please squash. I just ran the test _without_ your changes, and the test passes when it should not. Can you check this? |
Fix for iojs/io,js#1305 Before this, cluster bahaves not the way it is docummented Then disconnect is triggered, worker must wait for every server is closed before doing disconnect actually. See test case and discussion in the above mentioned issue
a923192 to
35854aeCompareOlegas
commented
Jun 2, 2015
@sam-github commits squashed, test fixed. |
There was a problem hiding this comment.
run make lint, this line is too long.
sam-github
commented
Jun 9, 2015
I would just do the lint fixups and merge, but I'd like you to confirm that I'm not missing some subtlety about the exit event testing. |
Olegas
commented
Jun 9, 2015
@sam-github Yes, exit event testing is not necessary. It is copy-paste from another cluster test ( |
Before this, cluster behaves not the way it is documented. When disconnect is triggered, worker must wait for every server is closed before doing disconnect actually. Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> PR-URL: nodejs#1400Fixes: nodejs#1305
sam-github
commented
Jun 9, 2015
Olegas
commented
Jun 9, 2015
@sam-github I'm sorry, but tests now broken. First If I run the test without my fixes, it will run forever. But if I set scheduling policy to This is because of default Then scheduling policy is |
Fishrock123
commented
Jun 9, 2015
@sam-github I think this probably needed a CI run, you have access to the CI, right? Anyways, here's a run on current master: https://jenkins-iojs.nodesource.com/view/iojs/job/iojs+any-pr+multi/788/ |
There was a problem hiding this comment.
Why is this block necessary? Won't checkRemainingHandles itself handle this?
There was a problem hiding this comment.
What if we have no any handles yet?
There was a problem hiding this comment.
Cool. Thanks for clarifying :-)
Wait for data to arrive from worker before doing a disconnect. Without this, whether the disconnect arrives at the worker before the master accepts and forwards the connection descriptor to the worker is a race. Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Rod Vagg <rod@vagg.org> PR-URL: #1953Fixes: #1933Fixes: #1400
Fix for #1305
Before this, cluster bahaves not the way it is docummented
Then disconnect is triggered, worker must wait for every server is closed
before doing disconnect actually.
See test case and discussion in the above mentioned issue