-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Shutdown hangs at "Stopping CommandReader thread" on some systems #25
Comments
I've already reported that to @PEMapModder before in Feb :P On 14 October 2016 at 16:34, Dylan K. Taylor notifications@github.com
|
Can't we just fake the input? |
@PrimusLV I tried, it either fails or segfaults. |
Confirmed on linux too |
I don't have this in macosx, can't believe this happening on Linux |
It happens on centos! If i stop server , i need to write a letter and submit , to stop! Didnt try to simply press enter xd! |
This strangely doesn't happen to me. |
And for all who have this issue on Linux/UNIX-based stuff try to update php. I don't think that this can happen in any Linux system |
THIS IS NOT A FORUM. Continue to treat it as one and bans will start getting handed out. |
Reproduced on other platforms (circumstances unknown). |
|
Found the cause of the |
Correction: not a MINTTY bug, just bad implementation. PHP CLI sees MINTTY as a pipe instead of an actual console. Reference: mintty/mintty#56. The same issue occurs on Travis using a blocking STDIN stream. The cause of this is that stream_select will always return 1 if the input is piped. |
Use stream_select to poll stdin status before reading Add detection for FIFO pipes, rewrite half of the CommandReader (again) Add timeout for CommandReader to prevent hang in Windows custom consoles (unknown reason)
…mmp/PocketMine-MP#171) Use stream_select to poll stdin status before reading Add detection for FIFO pipes, rewrite half of the CommandReader (again) Add timeout for CommandReader to prevent hang in Windows custom consoles (unknown reason)
Issue description
On Windows, shutdown will hang at "Stopping CommandReader thread" until another input is received, such as hitting the Enter key.
Why this happens
stream_set_blocking()
does not work on Windows. This results in thefgets()
call to stdin to block the thread until another input is received. This issue does not occur on Linux as far as I can tell.Possible solutions
This is a rather difficult problem to resolve cleanly. Since
Thread::kill()
was removed from pthreads in v3, the thread cannot be forcefully killed.I have made a previous attempt to resolve this with an implementation using
stream_select
which also fails on Windows (returns 1 when no streams have changed >:-[)Steps to reproduce the issue
OS and versions
References
PocketMine/PocketMine-MP#3990
https://bugs.php.net/bug.php?id=34972
The text was updated successfully, but these errors were encountered: