-
Notifications
You must be signed in to change notification settings - Fork 59
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
Using Discover inside cluster causes unhandled exception on windows #18
Comments
@wankdanker Why is this not a part of the master |
@Goran-n There was no pull request. Not, that I'm good at merging those in a timely mannger. Anyway, I just modified master if you want to try it out. |
@wankdanker I created this fix in a fork.. Also, sorry for my premature comment, after doing some testing the above code suggested actually conflcits with other reuseAddr uses within network.js. What i did was add a new variable called "exclusive". I've created a pull request if you want to merge it. If you think both can coexist then probably dont merge the pr. https://github.com/wankdanker/node-discover/pull/42 |
@Goran-n I like the granular approach. I think having it as a separate option is good and avoids conflicting with reuseAddr. I'll merge that. Thanks! |
node-discover@1.1.3 is on npm. Can you confirm that this fixes this bug on Windows? |
@wankdanker working on my end. I think you can close this. Thanks |
@Goran-n Awesome. Thanks for helping to push this along. |
According to NodeJS archives , sharing a UDP port on windows causes an ENOTSUP unhandled exception.
This ofcourse happens with Discover.
The solution offered is to mark UDP ports as exclusive. This does not solve the issue for someone wanting to have multiple cluster childs in the some discovery cluster, but it does for those using different childs for different Discovery clusters on different ports.
I managed to fix this on my development by changing
self.socket.bind(self.port, self.address, function () {
to
self.socket.bind({port:self.port, address:self.address,exclusive:true}, function () {
on
Network.prototype.start
in network.jsI think this can be also changed to
self.socket.bind({port:self.port, address:self.address,exclusive:!self.reuseAddr}, function () {
so that no extra option is created for this issue.
If some other solution exists for Windows, please forgive my ignorance. I am quite the beginner in nodejs-cluster development
The text was updated successfully, but these errors were encountered: