Class SystemdProperties.Threads
java.lang.Object
com.github.jpmsilva.jsystemd.spring.autoconfigure.SystemdProperties.Toggle
com.github.jpmsilva.jsystemd.spring.autoconfigure.SystemdProperties.Threads
- Enclosing class:
- SystemdProperties
The
ThreadStatusProvider, which provides information regarding the live threads, and detects deadlocks.
The ThreadStatusProvider is always a health provider of the watchdog, while enabled, and these properties control its health conditions.
Each health condition is opted into on its own, as it lets systemd restart the application: without any, the application is always healthy.
Both deadlock detection and deadlock health are disabled by default: detecting deadlocks shows them in the systemd status, and deadlock health
makes the application unhealthy while they last. Deadlock health requires detecting deadlocks: enabling deadlock-health while
deadlock-detection is disabled is an error, which fails the startup of the application.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if deadlocked threads are detected.booleanCheck if the watchdog heartbeat is suppressed while any thread is deadlocked.voidsetDeadlockDetection(boolean deadlockDetection) Enable or disable the detection of deadlocked threads.voidsetDeadlockHealth(boolean deadlockHealth) Enable or disable suppressing the watchdog heartbeat while any thread is deadlocked.Methods inherited from class com.github.jpmsilva.jsystemd.spring.autoconfigure.SystemdProperties.Toggle
isEnabled, setEnabled
-
Method Details
-
isDeadlockDetection
public boolean isDeadlockDetection()Check if deadlocked threads are detected.- Returns:
trueif deadlocked threads are detected
-
setDeadlockDetection
public void setDeadlockDetection(boolean deadlockDetection) Enable or disable the detection of deadlocked threads.- Parameters:
deadlockDetection-trueto detect deadlocked threads
-
isDeadlockHealth
public boolean isDeadlockHealth()Check if the watchdog heartbeat is suppressed while any thread is deadlocked.- Returns:
trueif deadlocked threads make the application unhealthy
-
setDeadlockHealth
public void setDeadlockHealth(boolean deadlockHealth) Enable or disable suppressing the watchdog heartbeat while any thread is deadlocked. Requires deadlock detection.- Parameters:
deadlockHealth-trueto make the application unhealthy while any thread is deadlocked
-