MySQL connection wait_timeout too small? (unsure of good title)
See original GitHub issueDescription
Describe the bug
When BentoBox is connected to a database, it causes some errors to show in console after long periods of no activity. The example I have shows that it last received a packet 60,522,509 ms ago.
[03:58:47 ERROR]: [BentoBox] Could not check if key exists in database! db8e5b84-c670-41f6-9a2b-1ad9a8c7e104 The last packet successfully received from the server was 60,522,509 milliseconds ago. The last packet sent successfully to the server was 60,522,510 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
Steps to reproduce the behavior
- Connect BentoBox to a database.
- Start the server, make sure the connection is valid.
- Wait for a while.
- Join the server.
- Observe the error in console.
Expected behavior
There should be no error.
Environment
Output of /bbox version
(Mandatory)
[06:05:56 INFO]: Running TUINITY 1.16.5.
[06:05:56 INFO]: BentoBox version: 1.16.2
[06:05:56 INFO]: Database: MARIADB
[06:05:56 INFO]: Loaded Game Worlds:
[06:05:56 INFO]: skyblock (Skyblock): Overworld, Nether, The End
[06:05:56 INFO]: Loaded Addons:
[06:05:56 INFO]: Bank 1.3.0 (ENABLED)
[06:05:56 INFO]: Border 3.1.0 (ENABLED)
[06:05:56 INFO]: BSkyBlock 1.14.4 (ENABLED)
[06:05:56 INFO]: Challenges 0.8.4 (ENABLED)
[06:05:56 INFO]: ControlPanel 1.13.0 (ENABLED)
[06:05:56 INFO]: DimensionalTrees 1.6.0 (ENABLED)
[06:05:56 INFO]: InvSwitcher 1.9.0 (DISABLED)
[06:05:56 INFO]: Level 2.7.0-SNAPSHOT-b460 (ENABLED)
[06:05:56 INFO]: Limits 1.15.5 (ENABLED)
[06:05:56 INFO]: MagicCobblestoneGenerator 2.3.0 (ENABLED)
[06:05:56 INFO]: TwerkingForTrees 1.4.1 (ENABLED)
[06:05:56 INFO]: Upgrades 0.2.0-SNAPSHOT-b83 (ENABLED)
[06:05:56 INFO]: Visit 1.3.0 (ENABLED)
[06:05:56 INFO]: Warps 1.10.2 (ENABLED)
Plugins (Optional)
Please ask for this if you need it, AFAIK it is irrelevant.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to setup a connection timeout depending of the user ...
mysql > SET SESSION wait_timeout = 60; mysql> SHOW VARIABLES LIKE 'wait_timeout'; ...shows 60. Then you can quit the session, reconnect, and ...
Read more >Connection timeout parameters in MySQL - Pythian Blog
Timeouts should be set very thoughtfully, based on the unique environment. If you're unsure, leave at defaults and adjust when needed. Finally, ...
Read more >MySQL 8.0 Reference Manual :: 5.1.8 Server System Variables
This comes into play when the main MySQL thread gets very many connection requests in a very short time. It then takes some...
Read more >Best practices for configuring parameters for Amazon RDS for ...
If a client is doing nothing for wait_timeout seconds, the MySQL server terminates the connection. The proper setting for this variable depends ...
Read more >Why decrease the wait_timeout configuration parameter in ...
If I make the wait_timeout too small then MySQL kills connections that are still valid in the connection pool my web application is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That worked perfectly. Thank you for the support!
Take backups, of course, but here are the steps:
/bbox migrate
.That should do it.