You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cdbb3fc
Browse filesBrowse the repository at this point in the historyBrowse files
Mark Pollack
committed
acp-micronaut: write the SSE closing comment before the event loops stop
With Micronaut's graceful shutdown off, the runtime drained the HTTP endpoint
in its @PreDestroy, whose place in the context's destroy order varies between
runs. When the event loop registry was destroyed first, Netty closed every
connection and the client saw the stream cut (IOException: closed, chunked
transfer encoding) instead of the closing comment. CI hit it in
AcpMicronautServerTest.closingTheApplicationEndsOpenStreamsAndWebSockets.
The runtime now closes the agent as the context's stop begins (ShutdownEvent),
before any bean is destroyed. Ending a stream only hands its last frame to
Micronaut, so the endpoint's host records each SSE stream it answers with and,
after the endpoint's close, waits until Micronaut has written each stream's
end (HttpRequestTerminatedEvent, published once the last content is written
and flushed), at most two seconds.
theClosingCommentIsWrittenBeforeTheEventLoopsStop shuts the event loops down
just before the runtime is destroyed, the order that loses the comment; it
failed every time before, for both a server stop and a context close.
0 commit comments