libasynql icon indicating copy to clipboard operation
libasynql copied to clipboard

Server does not cascade shutdown or recover when SQL workers crash

Open SOF3 opened this issue 3 years ago • 3 comments

Describe the bug A clear and concise description of what the bug is.

I accidentally changed the type of $queries for executeSelectRaw from list<string> to array{list<string>}. The query was serialized and unserialized in the worker send queue as-is, and only caused a crash when actually running in MysqliThread::executeQuery. This only crashes the worker thread, but the server keeps on running. If this happens in production scenario, all SQL workers will get stuck and all queries will end up taking forever to run, and server admin has no way to know what's wrong except by reading the crash output on the stdout, which does not even get sent to the PocketMine logger.

Environment hub.docker.com/pmmp/pocketmine-mp:4.0.2 OS: Ubuntu PocketMine version: 4.0.2

SOF3 avatar Dec 14 '21 11:12 SOF3

If you're using Worker it won't actually crash, it'll just bork the task involved. https://github.com/pmmp/pthreads/issues/34

dktapps avatar Dec 14 '21 15:12 dktapps

It isn't a worker. Just a thread on a wait loop.

Don't ask me why I didn't use a Worker.

SOF3 avatar Dec 14 '21 15:12 SOF3

This will be fixed by the release of pmmpthread 6.0.0 (https://github.com/pmmp/ext-pmmpthread/commit/5c595c1504686e0cb6e8828fca1c752dafc85e5f)

dktapps avatar May 16 '23 12:05 dktapps