-
Notifications
You must be signed in to change notification settings - Fork 175
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
Event-Publisher Flush Queue on Shutdown #767
Merged
KTAtkinson
merged 4 commits into
reddit:develop
from
atai92:add_queue_flushing_signal_handler
Mar 16, 2023
Merged
Event-Publisher Flush Queue on Shutdown #767
KTAtkinson
merged 4 commits into
reddit:develop
from
atai92:add_queue_flushing_signal_handler
Mar 16, 2023
Conversation
This file contains 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
ghirsch-reddit
approved these changes
Jan 26, 2023
sydjryan
approved these changes
Feb 7, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good, approving to quiet harold - I know we're talking in slack about when to release it
3 tasks
KTAtkinson
pushed a commit
that referenced
this pull request
Mar 16, 2023
vent-Publisher sidecar is not flushing the entire POSIX queue when receiving a SIGINT or SIGTERM. This PR creates a signal handler which will flush the queue whenever a SIGINT or SIGTERM is received. If this is not addressed, some applications that use the Event Publisher sidecar may experience dropped messages if their Event Publisher sidecar is terminated and the queue still has messages (ex: during a deployment).
KTAtkinson
added a commit
that referenced
this pull request
May 15, 2023
This reverts commit 62da77f.
KTAtkinson
added a commit
that referenced
this pull request
May 15, 2023
This reverts commit fcc0c45.
KTAtkinson
added a commit
that referenced
this pull request
May 15, 2023
This reverts commit fcc0c45.
KTAtkinson
added a commit
that referenced
this pull request
May 15, 2023
KTAtkinson
added a commit
that referenced
this pull request
May 15, 2023
seanrees
pushed a commit
to seanrees/baseplate.py
that referenced
this pull request
May 17, 2023
This reverts commit 62da77f.
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.
Closes #
💸 TL;DR
Event-Publisher sidecar is not flushing the entire POSIX queue when receiving a SIGINT or SIGTERM. This PR creates a signal handler which will flush the queue whenever a SIGINT or SIGTERM is received. If this is not addressed, some applications that use the Event Publisher sidecar may experience dropped messages if their Event Publisher sidecar is terminated and the queue still has messages (ex: during a deployment).
📜 Details
Design Doc
Jira
🧪 Testing Steps / Validation
Reproduced the issue by running the event-publisher, filling up the event queue, and adding events to the queue after each polling cycle by modifying the event-publisher
This keeps the queue saturated with something.
Then, force-closed the event-publisher using
ctrl-c
.Afterwards, check the POSIX queue to see if there are messages left over:
If we don't see a timeout, then we know that there was a message that was retrieved.
Note that the bad request above should not impact the test because the client error will only result in the messages being discarded due to a network error which is not the objective of this test.
To test the solution, the same test was done with the flush_queue_signal_handler() set for SIGINT and SIGTERM. As can be seen below, a TimedOutError was received when trying to get a message from the queue signaling that the queue was empty and flushed correctly.
These tests were both repeated a few times.
✅ Checks