poggit / libasynql

Asynchronous MySQL access library for PocketMine plugins.
https://poggit.github.io/libasynql
Apache License 2.0
132 stars 44 forks source link

Packets out of order #101

Closed ZoumiSurGithub closed 1 year ago

ZoumiSurGithub commented 1 year ago

Describe the bug It seems to happen when there hasn't been any requests for a while and then suddenly there are a lot.

Error on console: Fatal error: Uncaught ErrorException: Packets out of order. Expected 1 received 0. Packet size=145 in /home/zoumi/kitmap/plugins/Network/src/poggit/libasynql/mysqli/MysqliThread.php:96 Stack trace:

0 [internal function]: pocketmine\errorhandler\ErrorToExceptionHandler::handle(2, 'Packets out of ...', '/home/zoumi/kit...', 96)

1 /home/zoumi/kitmap/plugins/Network/src/poggit/libasynql/mysqli/MysqliThread.php(96): mysqli->ping()

2 /home/zoumi/kitmap/plugins/Network/src/poggit/libasynql/base/SqlSlaveThread.php(86): poggit\libasynql\mysqli\MysqliThread->executeQuery(Object(mysqli), 1, 'UPDATE players\n...', Array)

3 phar:///home/zoumi/kitmap/PocketMine-MP.phar/src/thread/CommonThreadPartsTrait.php(96): poggit\libasynql\base\SqlSlaveThread->onRun()

4 [internal function]: pocketmine\thread\Thread->run()

5 {main}

Sample code

Expected behavior

Environment OS: Debian 11 PocketMine version: 5.3.2

SOF3 commented 1 year ago

Basically poor error handling of libasynql. Duplicate of #85.

ZoumiSurGithub commented 1 year ago

Basically poor error handling of libasynql. Duplicate of #85.

but after a while, the data is no longer saved, so how can I force the connection to mysql again? and redo the previous queries?

SOF3 commented 1 year ago

libasynql doesn't do anything with your data. if the query was successful initially, its durability it's the responsibility of MySQL unless you deleted the data.

ZoumiSurGithub commented 1 year ago

let me explain, after a while I get an error with the ping, and it doesn't want to resume the connection with the server until I restart the server, which causes me to lose data, or maybe it's the waitAll I'm doing that's causing this.

SOF3 commented 1 year ago

Yeah, poor error handling in libasynql, let's track this in #85.