Is there a way in Springboot to isolate the readiness probe computation from the liveness probe computation? Typically the readiness probe has more risk to take long, e.g. when database connectivity checks time out, while the liveness probe is typically supposed to be more lightweight and be less affected by infrastructure issues. However, both typically share the same threadpool, i.e. if there are too many requests in too short a time to the readiness endpoint when it is slow, the liveness endpoint might take too long to respond and the application might be considered not alive, when it actually should be considered alive. Is there a way to separate both checks from each other? Options I would see:
The server used is undertow and the actuator endpoints already run on a separate port from the main application and thus have their own (small) threadpool. Thus they are isolated from the regular workload but not from each other.
It turns out both features (separating computation of the status and request handling as well as timelimits for computation of the status) have been requested by other users and are under consideration by spring. You can check out these issues to track the progress on these issues: https://github.com/spring-projects/spring-boot/issues/25459 https://github.com/spring-projects/spring-boot/issues/43449
In addition the tests currently run sequentially and running them parallel is also under consideration here: https://github.com/spring-projects/spring-boot/issues/2652
Since all of these issues are already open for a while, the threads mention a few ways to implement the respective behavior on the application side overwriting the existing status checks. In particular, there is also this library that combines these features and allows to use them for any health check via annotation: https://github.com/antoinemeyer/spring-boot-async-health-indicator Note that it still would need you to overwrite any existing status checks to apply the different behavior to them (and disable the default version).