Skip to content
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

Force kill on shutdown #170

Closed
alex2534alex opened this issue Dec 17, 2016 · 19 comments
Closed

Force kill on shutdown #170

alex2534alex opened this issue Dec 17, 2016 · 19 comments
Labels
Category: Core Related to internal functionality Resolution: Fixed

Comments

@alex2534alex
Copy link
Contributor

alex2534alex commented Dec 17, 2016

Issue description

Server killed forcefully after "Stopping other threads"

Steps to reproduce the issue

  1. Stop server

OS and versions

  • PocketMine-MP: 61e8828
  • PHP: 7.0.13
  • Server OS: Linux Mint 18

Crashdump, backtrace or other files

[Server thread/INFO]: Stopping other threads

Took too long to stop, server was killed forcefully!

@alex2534alex
Copy link
Contributor Author

Not always, but very often

@robske110
Copy link
Contributor

Hmm, I guess we need to add some more debug to this, because we don't need which thread wouldn't want to die...

@alex2534alex
Copy link
Contributor Author

alex2534alex commented Dec 17, 2016

@robske110

[Server thread/INFO]: Stopping other threads
[Server thread/DEBUG]: Stopping Console thread
[Server thread/DEBUG]: Stopping Asynchronous Worker #1 thread
[Server thread/DEBUG]: Stopping Asynchronous Worker #2 thread
[Server thread/DEBUG]: Stopping Server Killer thread

Took too long to stop, server was killed forcefully!

@robske110
Copy link
Contributor

This is the old issue with the logger not exiting, I think this is also a duplicate issue

@dktapps
Copy link
Member

dktapps commented Dec 17, 2016

No, this is an issue with the Server Killer itself. You can see from the log that all other threads have stopped successfully. I've seen this issue occasionally myself where the server killer fails to stop. This may be a pthreads bug.

@dktapps dktapps added Category: PHP (extension) Status: Reproduced Bug has been reproduced, but cause has not yet been identified labels Dec 17, 2016
@dktapps dktapps reopened this Dec 17, 2016
@dktapps
Copy link
Member

dktapps commented Dec 18, 2016

In Ubuntu 16.10, this happens every single time I shut the server down. Quite irritating to be truthful.

@L3ice
Copy link

L3ice commented Jan 25, 2017

[Server thread/INFO]: Stopping other threads
[Server thread/DEBUG]: Stopping Console thread
[Server thread/DEBUG]: Could not stop Console thread: STDIN is being piped from another location and the pipe is blocked, cannot stop safely
[Server thread/DEBUG]: Stopping Asynchronous Worker #1 thread
[Server thread/DEBUG]: Asynchronous Worker #1 thread stopped successfully.
[Server thread/DEBUG]: Stopping Asynchronous Worker #2 thread
[Server thread/DEBUG]: Asynchronous Worker #2 thread stopped successfully.
[Server thread/DEBUG]: Stopping Server Killer thread
[Server thread/DEBUG]: Server Killer thread stopped successfully.

Is this a different issue?

@robske110
Copy link
Contributor

That is no issue, it's simply a debug message.

@L3ice
Copy link

L3ice commented Jan 25, 2017

@robske110

[Serverthread/DEBUG]: Could not stop Console thread: STDIN is being piped from another location and the pipe is blocked, cannot stop safely

Some threads could not be stopped, performing a force-kill

bin\php\php.exe: Exit 1.

I think that is indeed an issue

@dktapps
Copy link
Member

dktapps commented Jan 25, 2017

@L3ice your issue is the underlying issue behind #25 . It's just better managed now. Don't worry about it, it doesn't harm anything.

@dktapps
Copy link
Member

dktapps commented Jan 25, 2017

I recommend you use PowerShell to run PocketMine-MP on Windows now. The issue will not occur under PowerShell. The reasons why the issue occurs are detailed at #171

@L3ice
Copy link

L3ice commented Jan 25, 2017

@dktapps I already use Powershell(and its great, except for that spacing issue when you maximize the window, that is also occuring in cmd.exe) instead of MinTTY.
And I already read the whole text, maybe not good enough!
So as a user I just have to wait for updated php binaries, I guess

@dktapps
Copy link
Member

dktapps commented May 18, 2017

@alex2534alex how many CPU cores does the machine have available?

I've observed that on a Ubuntu virtual machine with one logical core, this issue will:

  • always occur with 1 CPU core
  • frequently with 2

The server killer does not start until something attempts to join it, resulting in a force-kill on shutdown.

@alex2534alex
Copy link
Contributor Author

I have Intel Celeron with 1 CPU core and frequently 2.2 GHz

@dktapps dktapps added Status: Debugged Cause of the bug has been found, but not fixed and removed Status: Reproduced Bug has been reproduced, but cause has not yet been identified labels May 18, 2017
@dktapps
Copy link
Member

dktapps commented May 18, 2017

Well... that explains it. You need a better machine ;)

@alex2534alex
Copy link
Contributor Author

alex2534alex commented May 18, 2017

I also think so, but I can't afford it. The only way to solve this problem for me is to wait for a solution 😅

@dktapps
Copy link
Member

dktapps commented May 18, 2017

@alex2534alex would you mind testing https://github.com/pmmp/PocketMine-MP/tree/issues%2F170 please? Works for me on a single-core virtual machine.

@alex2534alex
Copy link
Contributor Author

Tested. Fix works :)

@inxomnyaa
Copy link
Contributor

Finally! Works like a charm <3

@dktapps dktapps added Resolution: Fixed and removed Category: PHP (extension) Status: Debugged Cause of the bug has been found, but not fixed labels May 18, 2017
@XDqrkneZ XDqrkneZ mentioned this issue Jun 10, 2017
@dktapps dktapps added Category: Core Related to internal functionality and removed Category: Other labels Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Core Related to internal functionality Resolution: Fixed
Projects
None yet
Development

No branches or pull requests

6 participants