Open JaxkDev opened 3 years ago
Seems to be this loop https://github.com/poggit/libasynql/blob/50ac73e295869f97a46fad1d55af749608558f6e/libasynql/src/poggit/libasynql/libasynql.php#L137-L139
Could make this async indeed.
Yes, I used to have a plugin that attempt to reconnect the database every 5 minutes if the connection failed has on enable. And it really did make people think I'm running queries on main thread oof.
Not sure if this is directly related but I'm seeing very long waits on close() as well.
[17:53:10] [Server thread/INFO]: Disabling FusionCore v1.0.0
[17:53:13] [RakLibServer thread/DEBUG]: Closed session for 172.20.10.1 52534
[17:53:13] [RakLibServer thread/DEBUG]: Ignored connected packet from 172.20.10.1 52534 due to no session opened (0xc0)
[17:54:24] [Server thread/INFO]: JaxkDev left the game
[17:54:25] [Server thread/INFO]: JaxkDev[/172.20.10.1:52534] logged out due to Server closed
[17:54:25] [Server thread/DEBUG]: Unloading all worlds
[17:54:25] [Server thread/INFO]: Unloading world "world"
[17:54:25] [Server thread/DEBUG]: Removing event handlers
1m 25s to close, the only thing called on disable is this: $this->db->close();
where $this->db
is the data connector from the return of libasynql::create()
Describe the bug During initial construction of the libasynql if you have a internet connection issue or DB issue you can expect waits of up to 3 minutes PER plugin that uses libasynql.
Sample code
Expected behavior Smaller timeout or connection made async (not sure how its done backend)
Environment OS: Windows 10 PocketMine version: 3.19.0 PHP: 8.0.3
Log
Take note of timestamps, if several plugins were to have libasynql and they all failed like above during initial connection that could be an extremely long wait before the user can interact with the server (stop command etc)