forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(jdbc-mysql): clean up abandoned connection when quarkus app runs…
… in native mode Make sure that abandoned threads are cleaned up even in native mode using the same algorithm used in JVM mode.
- Loading branch information
Showing
3 changed files
with
119 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...ns/jdbc/jdbc-mysql/runtime/src/main/java/io/quarkus/jdbc/mysql/runtime/MySQLRecorder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package io.quarkus.jdbc.mysql.runtime; | ||
|
||
import org.graalvm.nativeimage.ImageInfo; | ||
|
||
import io.quarkus.jdbc.mysql.runtime.graal.AbandonedConnectionCleanupThread_disable; | ||
import io.quarkus.runtime.annotations.Recorder; | ||
|
||
@Recorder | ||
public class MySQLRecorder { | ||
|
||
public void startAbandonedConnectionCleanup() { | ||
if (ImageInfo.inImageRuntimeCode()) { | ||
AbandonedConnectionCleanupThread_disable.startCleanUp(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters