-
Notifications
You must be signed in to change notification settings - Fork 16
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
fix bad assertion #6
base: master
Are you sure you want to change the base?
Conversation
My concern with your fix is that it will be very difficult for someone to debug the situation where they accidentally forget to provide an Did you run into the situation you outlined above, or is it a theoretical concern? |
Yes I run into the situation. It happens about every six hours or so in a system where constantly ~100 sockets are open. A better place to put the assertion would be when creating the socket. |
Ah, I had no idea anyone was using this library = ) Putting assertions for in/out channels where the socket is created sounds like a good idea; it just needs to match up with the ZeroMQ socket types (since some of them don't always take both). Would be happy to accept a pull request for that. |
Done. Omitting in channel seems like a bad idea to me, because then you have no way of shutting down the socket. Maybe it is legitimate for systems that don't manage sockets dynamically. |
Awesome, looks good to me. Did you also want to remove the original assertion you opened the issue about? |
Yes it is removed. This pull request contains two commits, the first one does that, and the second one adds the new assertions. |
Oh, sorry. I didn't notice that. Can you please squash these into a single commit with descriptive message (e.g., "Check for in/out chans when registering socket rather than within internal machinery") |
This assertion will fail under legitimate circumstances.
Consider the following sequence of events: