Prior to this commit, the fix for gh-32730 disabled the involvment of
the osbervation filter for async dispatches. Instead of relying on ASYNC
dispatches to close the observation for async requests, this is now
using an async listener instead: async dispatches are not guaranteed to
happen once the async request is handled.
This change caused another side-effect: because async dispatches are not
considered anymore by this filter, the observation scope is not
reinstated for async dispatches. For example, `ResponseBodyAdvice`
implementations do not have the observation scope opened during their
execution.
This commit re-enables async dispatches for this filter, but ensures
that observations are not closed during such dispatches as this will be
done by the async listener.
Fixes gh-33128
@ -97,6 +98,11 @@ public class ServerHttpObservationFilter extends OncePerRequestFilter {
@@ -97,6 +98,11 @@ public class ServerHttpObservationFilter extends OncePerRequestFilter {
@ -116,8 +122,9 @@ public class ServerHttpObservationFilter extends OncePerRequestFilter {
@@ -116,8 +122,9 @@ public class ServerHttpObservationFilter extends OncePerRequestFilter {
@ -176,7 +183,6 @@ public class ServerHttpObservationFilter extends OncePerRequestFilter {
@@ -176,7 +183,6 @@ public class ServerHttpObservationFilter extends OncePerRequestFilter {