mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
da95542d8f
Prior to this commit, HTTP server observations for Spring WebFlux could be recorded twice for a single request in some cases. The "COMPLETE" and "CANCEL" signals would race in the reactive pipeline and would trigger both the `doOnComplete()` and ` `doOnCancel()` operators, each calling `observation.stop()` on the current observation. This would in fact publish two different observations for the same request. This commit ensures that the instrumentation uses the `Mono#tap` operator to guard against this case and only call `Observation#stop` once for each request. Fixes gh-31417