Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

test: fix test-cluster-disconnect #6840

Closed
wants to merge 2 commits into from
Closed

test: fix test-cluster-disconnect #6840

wants to merge 2 commits into from

Conversation

orangemocha
Copy link
Contributor

The first commit fixes the test.
The second commit is not absolutely critical, however I discovered thanks to the broken test that when a channel is closed that has a handle queue on it, the disconnect event will never fire.

The test was not waiting for all the worker-created sockets
to be listening before calling cluster.disconnect().
As a result, the channels with the workers could get closed
before all the socket handles had been passed to them, leading
to various errors.
When a child process closes the channel to the parent, we should
call _disconnect(), which raises the 'disconnect' event immediately,
rather than disconnect(), which can potentially be deferred if
there is a handle queue on the channel. A deferred disconnect would
never be processed because the other side is gone and the channel
will never be drained.
@tjfontaine
Copy link

I'm going to land the first commit, can we get a test for the second commit?

@tjfontaine
Copy link

first part is landed in dc1ffd0

@orangemocha
Copy link
Contributor Author

The test failure has been fixed and there is no evidence that the issue addressed by 7d0e06c can actually occur.

@orangemocha orangemocha deleted the orangemocha-clusterdisconnect branch April 10, 2014 10:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants