-
-
Notifications
You must be signed in to change notification settings - Fork 499
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
Is it possible to create a reliable cross platform listener for pipe0 that waits until specified socket is released by other process #1567
Comments
Hello. Let me explain this issue: The main question on more abstract level is how robust is this library given that
Would NNG library try to listen on that interface again, or some external watchdog thread is needed to achieve that? In my opinion, NNG connection is expected to be robust and external watchdog defeats the purpose of this library. |
At present, this behavior is not the available in NNG, although it would be possible to have a thread that sits in a loop and calls nng_listener_start() repeatedly until succeeds (presumably sleeping a second or two between retries.) Nanomsg does have this ability, but we found it to be problematic and confusing for most users, so we didn't implement it in NNG. I would possibly be amenable to implementing this capability. If you need it urgently, let me know out of band and I can try to allocate some time at a higher priority. |
This is not urgent, our team is in the process of discussion of possible ways of dealing with this problem. As of now, some of our automatic tests sporadically fail with probability of ~3-5% because one of instances of test binary haven't released pipe0 in time. |
Hello. Yes, I'd like to confirm that this feature is indeed needed for our project. Sorry for delay. |
Ok, I'll see if I can put something together... |
did some tests on Windows 10 x64: once windows gets in to a problematic state ( you can find my test here: https://gist.github.com/alzix/2f9fb93b026835eb9ba57d780966b658 my tests show that closing the process and restarting does help - so when running the test executable in a loop next test executable invocation typically passes:
|
If your application has exhausted the socket address space, or a previous application is holding the address, or the connection died abnormally, it can cause the socket address to be held for the duration of the socket time, Which can be a while. |
the test was performed on windows with named-pipes - once the pipe is closed in some cases it cannot be reopened. |
I really want to throw Windows Named Pipes into the dumpster. But probably not right away. Maybe for a 2.0 release because it will be breaking. |
I've made a lot of changes lately -- I think that one of the IPC leaks here that was causing problems is fixed now. Can someone retry? That said, I do plan to replace Windows named pipes with UNIX domain sockets soon. |
In this code
nng_listener_start
returns 10 in case when given address is already taken by concurrent process despiteNNG_FLAG_NONBLOCK
flag is specified. Is it possible to make listener wait until given address is available without creatingauxiliary threads? As far as I understand, internal
aio
pools are unavailable for client code, so I can't offload periodic listen attempt to one of nng threads.The text was updated successfully, but these errors were encountered: