-
Notifications
You must be signed in to change notification settings - Fork 41k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Record WebFlux server metrics for client disconnection #23606
Comments
@cdmatta Are you able to share this code as a complete project that we can run? Either a link to a GitHub project or an attached zip would be ideal. |
Thanks @philwebb . I added sample code here https://github.com/cdmatta/sb-conn-interruption-issues Added 2 modules mvc and reactive to allow comparison + JMeter script. Compared against mvc stack. When client interrupts the call
When server interrupts the request (processing took too long)
In the Reactive stack when I add a WebFilter, I can see the cancel signal. |
Version: Spring Boot 2.3.4.RELEASE with Webflux & Metrics
Scenario:
In both the above cases, one can see a log generated due to connection abort (client/server). However, no metrics are generated.
Project dependencies
Use JMeter for the tests below
Call the /five endpoint. Abort the call before 5 seconds.
Result -
No metrics are generated
Call the /twenty endpoint.
Result -
After 10 seconds, Client receives connection closed - org.apache.http.NoHttpResponseException: 127.0.0.1:8080 failed to respond.
No metrics are generated.
Call the /fifty endpoint
Result -
Strangely enough, after 50 seconds, the call succeeds with response "Call took 50 seconds"
Metric is generated.
But why is the connection not interrupted by the server ? Read/Write timeout is configured for 10 seconds.
Call the /fifty endpoint. Abort the call in 10 seconds.
Result -
The iterating/sleeping thread does not get interrupted, interal loop succeeds.
Exception is noticed in log after the entire loop.
Metrics look like http_server_requests_seconds_max{exception="IOException",method="GET",outcome="SUCCESS",status="200",uri="/fifty",} 50.157466
The text was updated successfully, but these errors were encountered: