-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: SIGNAL-7060 preemtively drop large messages from queue (#101)
## Related Ticket(s) SIGNAL-7060 <!-- Enter the Jira issue below in the following format: PROJECT-## --> ## Checklist <!-- For each bullet, ensure your pr meets the criteria and write a note explaining how this PR relates. Mark them as complete as they are done. All top-level checkboxes should be checked regardless of their relevance to the pr with a note explaining whether they are relevant or not. --> - [x] Code conforms to the [Elixir Styleguide](https://github.com/christopheradams/elixir_style_guide) ## Problem We added logic to drop large messages during termination, but we still observed raw `:message_too_large` errors bubbling up from brod code. Due to the sheer traffic in topic `wms-service--firehose`, these errors are observed once or twice every other day. ## Details Preemptively drop large messages from even being attempted. Currently prior to this PR, `AsyncWorker.build_message_batch()` would attempt to push the message out to Kafka without checking the size. This PR will check at the `AsyncWorker.queue()` lifecycle, so when request comes into this GenServer to put a new message to the queue, it will check and drop the large message - if it goes over `state.max_request_bytes`. The dropped messages follow the same logging code which should push out the message to DataDog. --------- Co-authored-by: Sam Hunter <1526888+kinson@users.noreply.github.com>
- Loading branch information
1 parent
267bd67
commit 0baeae8
Showing
3 changed files
with
143 additions
and
48 deletions.
There are no files selected for viewing
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
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
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