spring-boot-admin icon indicating copy to clipboard operation
spring-boot-admin copied to clipboard

Bug: StatusUpdater timeout is ignored

Open cdprete opened this issue 8 months ago • 7 comments

Spring Boot Admin Server information

  • Version: 4.0.2

  • Spring Boot version: 4.0.3

  • Configured Security: None

  • Webflux or Servlet application: WebFlux

Client information

Not needed.

Description

Hello.

According to the documentation at https://docs.spring-boot-admin.com/4.0.2/docs/customization/monitoring/custom-health-status/#example-custom-timeout, it should be possible to change the timeout used by the StatusUpdater by simply defining the bean in the context with the wanted timeout.

Too bad that StatusUpdateTrigger changes it to the value interval from IntervalCheck, ignoring therefore the value set previously:

Image

cdprete avatar Mar 09 '26 11:03 cdprete

I can confirm it's ignored since I've set it to 30s but then I can still see status events like

{
  "data": {
    "instance": "c19d849cce89",
    "version": 1415,
    "type": "STATUS_CHANGED",
    "timestamp": "2026-03-12T14:17:50.594Z",
    "statusInfo": {
      "status": "OFFLINE",
      "details": {
        "exception": "java.util.concurrent.TimeoutException",
        "message": "Did not observe any item or terminal signal within 9000ms in 'log' (and no fallback has been configured)"
      },
      "outOfService": false,
      "restricted": false
    },
    "key": "c19d849cce89-1415-STATUS_CHANGED-1773325070594",
    "date": "2026-03-12T14:17:50.594Z",
    "application": "BFP (INT)"
  },
  "index": 3
}

where 9s is reported instead of 29s.

cdprete avatar Mar 12 '26 14:03 cdprete

Hi @SteKoe. Can we please add a configuration property (e.g.: statusTimeout) under https://github.com/codecentric/spring-boot-admin/blob/master/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/config/AdminServerProperties.java#L91 so that there is no need to redefine the bean in the context for it?

This is just a side request and I can easily open a PR for it. Of course, it doesn't fix the issue reported in here.

cdprete avatar Mar 17 '26 15:03 cdprete

Analysis and Proposed Fix

I've investigated this issue and confirmed the bug. Here's a detailed breakdown:

Root Cause

In StatusUpdateTrigger.updateStatus() (line 57), every status check cycle unconditionally calls:

this.statusUpdater.timeout(this.intervalCheck.getInterval())
    .updateStatus(instanceId)

StatusUpdater.timeout(Duration) is a mutable setter — it overwrites the internal timeout field and returns this. Since intervalCheck.getInterval() returns the status-check interval (default 10s), any user-configured timeout is silently replaced before updateStatus() executes.

This explains why @cdprete observes TimeoutException at 9000ms despite configuring 30s: the StatusUpdater applies a 1-second margin in getTimeoutWithMargin() (timeout.minusSeconds(1)), so the effective timeout becomes 10s - 1s = 9s — exactly matching the reported error.

Why this is inconsistent

InfoUpdateTrigger.updateInfo() calls this.infoUpdater.updateInfo(instanceId) directly, without overriding any timeout. StatusUpdateTrigger is the only trigger that forcefully resets the updater's timeout on every cycle.

Fix (PR submitted)

  1. Remove the timeout() override from StatusUpdateTrigger.updateStatus() — call statusUpdater.updateStatus() directly, consistent with InfoUpdateTrigger.
  2. Apply monitor.defaultTimeout from AdminServerProperties when constructing the auto-configured StatusUpdater bean in AdminServerAutoConfiguration, so the property spring.boot.admin.monitor.default-timeout is correctly respected.

After this fix:

  • Default behavior is unchanged (timeout remains 10s from defaultTimeout property default).
  • Custom StatusUpdater beans with user-defined timeouts are now honored, as the documentation states.
  • The spring.boot.admin.monitor.default-timeout property correctly applies to status health checks.

PR: #5210

Regarding the side-request for a dedicated statusTimeout configuration property — that would be a separate enhancement and is not addressed here.

herley-shaori avatar Mar 29 '26 02:03 herley-shaori

Hello @herley-shaori.

Thanks for the proposed fix. There are 3 open points, though:

  1. default-timeout should be used only if no other timeout is specified for the health endpoint. SBA allows to configure the timeout on a per-endpoint basis and setup a default one (the one you mentioned) if, for a given endpoint, there is no specific one set.
  2. According to the reply of @ulischulte in https://github.com/codecentric/spring-boot-admin/issues/4516#issuecomment-3143108287, 10s is somehow intentional. Therefore, an agreement with the team needs to be found on how this should indeed behave.
  3. It needs to be properly verified what happens when the timeout applied for updating the status is bigger than the one used by IntervalCheck.

From my side, I opened the bug report because I was surprised to read in the documentation of version 4.x that this can now be changed given the discussions we had in https://github.com/codecentric/spring-boot-admin/issues/4516.

cdprete avatar Mar 29 '26 10:03 cdprete

fixed with #5237

ulischulte avatar Apr 10 '26 13:04 ulischulte

Hi @ulischulte.

I fail to see, in that PR, the difference with the previous 3.x implementation. The timeout gets anyway capped to the interval, which was already the case in version 3.x and which goes against what's said in the SBA docs where it's exactly shown an example on how to increase the timeout to 30s.

So, I think that the approved and released PR brings almost no benefits at all. The only benefit, if you want to call it in this way, I can see is that now you can have a status timeout < interval timeout.

Does it brings really any benefit? I doubt. Does it clarify the misunderstanding in the docs, which was the scope of this ticket? No. Does it make SBA easier to maintain? Not at all. Does it solve my issue in https://github.com/codecentric/spring-boot-admin/issues/4516 or does it make better? No. Even worse, now things can be misconfigured even more (again :)), but without even a warning this time.

Just my 2 cents here ;)

cdprete avatar Apr 10 '26 19:04 cdprete

Hello @ulischulte, @SteKoe, @hzpz.

Please open this again. See https://github.com/codecentric/spring-boot-admin/pull/5237#issuecomment-4234038308 for details.

cdprete avatar Apr 13 '26 05:04 cdprete