Plot-System icon indicating copy to clipboard operation
Plot-System copied to clipboard

[Bug] - Allow setting Hikari Connection options - maxLifeTime Bug

Open Zoriot opened this issue 9 months ago • 0 comments

Description

Steps to Reproduce

  1. Use a Database server which closes connection after a short time
  2. Let the Plugin run idle
  3. Do smt like creating a plot

Possible Solution

You can configure maxLifetime in the config and find the sweatspot for your server/database.

[13:41:10] [Craft Scheduler Thread - 11 - Plot-System/WARN]: [com.zaxxer.hikari.pool.PoolBase] HikariPool-2 - Failed to validate connection org.mariadb.jdbc.MariaDbConnection@703a5aac ((conn=173157) Connection.setNetworkTimeout cannot be called on a closed connection). Possibly consider using a shorter maxLifetime value.

Related Code: https://github.com/AlpsBTE/Plot-System/blob/5e0ecacfcc41e4f0bb42c656736bb2d21a2c6912/src/main/java/com/alpsbte/plotsystem/core/database/DatabaseConnection.java#L54-L75

HikariCP Docs

It also needs to be adjusted in other plugins where we use Hikari.

Zoriot avatar Mar 20 '25 03:03 Zoriot