feat(server): Accept inflight requests during shutdown#5769
Merged
Conversation
jjbayer
commented
Mar 26, 2026
Comment on lines
-68
to
-74
| # After relay exits, new connections are refused. | ||
| relay.wait_for_exit(timeout=10) | ||
| try: | ||
| socket.create_connection((host, port)) | ||
| assert False, "Expected connection to be refused after relay exited" | ||
| except ConnectionRefusedError: | ||
| pass |
Member
Author
There was a problem hiding this comment.
This takes a long time and was not really the purpose of the test.
Contributor
|
I might be lacking a bit of context from the previous PRs, but can you elaborate on how this change "saves" the requests? |
Member
Author
@loewenheim I added more details to the PR description, I hope this clarifies things. I also changed the word "save" to "accept" because "save" is ambiguous. |
Contributor
|
Thanks, the additional details clear it up. |
loewenheim
approved these changes
Mar 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With #5746 and #5751, we should be able to process all inflight requests even during shutdown.
Previous behavior:
New behavior:
spool.envelopes.ephemeral:true(which it is in SaaS), the envelope buffer service will keep accepting & processing envelopes until the process is killed. Inflight requests are accepted with 200 because theAddrof the envelope buffer service is still open.false, the envelope buffer will flush its in-memory state to disk and stop accepting envelopes. Inflight requests are rejected with 503 like before.Note that the axum server rejects all requests once the shutdown signal has been received, so this only affects requests that are already being handled while the envelope buffer shuts down.
Fixes INGEST-510