Skip to content

Async requests are not considered when shutting down gracefully #2717

@wilkinsona

Description

@wilkinsona

I'm trying to enhance Spring Boot's Jetty integration to optionally gracefully shut down Jetty. It's working nicely for synchronous requests but does not work for asynchronous requests. If I call StatisticsHandler.shutdown when there's a single asynchronous request in progress, the returned future is completed immediately rather than only completing once the request has completed.

Here's the stats HTML captured at the time of StatisticsHandler calling shutdown.succeeded():

<h1>Statistics:</h1>
Statistics gathering started 14026ms ago<br />
<h2>Requests:</h2>
Total requests: 1<br />
Active requests: 1<br />
Max active requests: 1<br />
Total requests time: 0<br />
Mean request time: 0.0<br />
Max request time: 0<br />
Request time standard deviation: 0.0<br />
<h2>Dispatches:</h2>
Total dispatched: 1<br />
Active dispatched: 0<br />
Max active dispatched: 1<br />
Total dispatched time: 32<br />
Mean dispatched time: 32.0<br />
Max dispatched time: 32<br />
Dispatched time standard deviation: 0.0<br />
Total requests suspended: 1<br />
Total requests expired: 0<br />
Total requests resumed: 0<br />
<h2>Responses:</h2>
1xx responses: 0<br />
2xx responses: 0<br />
3xx responses: 0<br />
4xx responses: 0<br />
5xx responses: 0<br />
Bytes sent total: 0<br />

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions