-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix: Improve Kafee exception handling #126
Conversation
# Dialyzer can't recognize that :ok is a valid return type for this function | ||
# due to the rescue clause in push_message/3 | ||
@dialyzer {:nowarn_function, do_consumer_work: 3} |
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.
I believe the rescue
on Kafee.Consumer.Adapter.push_message
makes Dialyzer think that {:error, Exception.t()}
is the only possible return... I've tried a couple different ways to fix without luck. Open to ideas
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.
💥
An automated release has been created for you. --- ## [3.5.1](v3.5.0...v3.5.1) (2024-12-13) ### Bug Fixes * Improve Kafee exception handling ([#126](#126)) ([fa5bd44](fa5bd44)) * Update kafee consumer handle_failure/2 fn ([#119](#119)) ([4c12df7](4c12df7)) ### Miscellaneous * Correct documentation to include start.count metric ([#125](#125)) ([3ab284c](3ab284c)) * Sync files with stordco/common-config-elixir ([#128](#128)) ([3adffb8](3adffb8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Related Ticket(s)
SIGNAL-7451
Checklist
Problem
We've noticed on wms-service that under high load, sometimes we get error messages in our consumers. These bubble up and trigger the exception handling of
Broadway
. This PR aims to more gracefully catch exits that occur inTask.await_many/2
and mark the messages as failed.Details
There is also a shift in approach - instead of manually calling
handle_failure
and then returning the message in failed cases, I am opting to shift our usage to reflect the library.handle_failure
is called by the library itself, so there's no need for Kafee to call it manually if we useBroadway.Message.failed/2