Skip to content

Acknowledge original messages when handle_failed/2 drops some - #380

Closed
Tekdokto wants to merge 1 commit into
elixir-broadway:mainfrom
Tekdokto:fix/handle-failed-partial-return
Closed

Tekdokto wants to merge 1 commit into
elixir-broadway:mainfrom
Tekdokto:fix/handle-failed-partial-return

Conversation

@Tekdokto

Copy link
Copy Markdown

Summary

c:Broadway.handle_failed/2 must return every message it is given. When the callback returned a list of a different length, Broadway logged the mistake and then continued with that list. Messages left out of the list were never acknowledged. A non-list return already ignored the bad value and kept the originals; a list of the wrong length now does the same.

Test plan

  • mix test test/broadway_test.exs
  • New regression: handle_failed/2 returning [] still acks the original failed message

Made with Cursor

A list of the wrong length was logged and then used, so the missing messages were never acknowledged.
@josevalim

Copy link
Copy Markdown
Contributor

Thank you but this also discards information, because you no return the updated messages from handle_failed. Discarding messages is a failure, there is no way we can act correctly if you do that. Whatever we pick is faulty because the implementation is faulty.

@josevalim josevalim closed this Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants