-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
hang on exit after listen() #2331
Comments
Only seems to happen at the REPL. Same thing stuffed in a script seems fine. |
This is the same problem we had with pipes. libuv marks the server pipe as writable (https://github.com/joyent/libuv/blob/master/src/unix/tcp.c#L63) so we try to wait for it to drain & shutdown, except that it's not actually writable so it can't respond to the shutdown request (although it thinks that it can) i'm guessing that it doesn't happen in your script since you don't call uv_run() prior to exiting, so the socket is never fully created and the shutdown works properly |
Is there an official way to call |
Base.runeventloop() or whatever it is called now. |
The socket is definitely open, as I was able to netcat to it. I'm not sure what "fully created" means in the libuv context, though. |
i guess the socket was fully created then. (some initialization may be delayed until the call to uv_run, which would be after the closing flags got set, if this occurred in uv_atexit_hook for the first time). I'm not sure what the difference would be then. maybe the REPL is doing something funny to the way exit(0) gets called? I recommend not using Base.runeventloop(), since it may expect to be run from the scheduler. yielding to the scheduler should be sufficient. I think that it is setup such that when the main task terminates, exit(0) gets called explicitly. if you don't want that to happen, I would do |
Fixed by 32f365d |
If I type this:
and then quit the repl, julia hangs. Here is a stacktrace during the hang:
The text was updated successfully, but these errors were encountered: