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

public static class SystemdProperties.Threads extends SystemdProperties.Toggle
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 Details

    • isDeadlockDetection

      public boolean isDeadlockDetection()
      Check if deadlocked threads are detected.
      Returns:
      true if deadlocked threads are detected
    • setDeadlockDetection

      public void setDeadlockDetection(boolean deadlockDetection)
      Enable or disable the detection of deadlocked threads.
      Parameters:
      deadlockDetection - true to detect deadlocked threads
    • isDeadlockHealth

      public boolean isDeadlockHealth()
      Check if the watchdog heartbeat is suppressed while any thread is deadlocked.
      Returns:
      true if 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 - true to make the application unhealthy while any thread is deadlocked