• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dashbitco / broadway / 0160e33666b8ae8fdfb245bb0ac3b8d5d0a49817-PR-362
93%
main: 93%

Build:
Build:
LAST BUILD BRANCH: yordis/fixes-353
DEFAULT BRANCH: main
Ran 30 Jul 2025 01:58PM UTC
Jobs 1
Files 21
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

30 Jul 2025 10:41AM UTC coverage: 92.982% (-0.1%) from 93.119%
0160e33666b8ae8fdfb245bb0ac3b8d5d0a49817-PR-362

Pull #362

github

rslota
Fix graceful shutdown race condition

Currently, when `Topology` is shutting down, it calls `Terminator.trap_exit/1` to allow it to handle `terminate/2` callback and shutdown producers gracefully.
However, `Terminator.trap_exit/1` is using `GenServer.cast/2` which makes it fully asynchronous, making it possible for `Topology`'s
terminate callback to return before `Terminator` starts trapping exits, allowing `Terminator` to be shut down without putting producers into "draining" state.

In my system when we're running ~50-100 Broadway instances we're seeing ~50% of them shutting down properly and the rest of them get stuck with producers
going full blast unaware of the shutdown.

This change simply changes `Terminator.trap_exit/1` to use `GenServer.call/2` instead of `GenServer.cast/2` to make it fully synchronous, which fixed the issue.
Since I don't know Broadway internals at all, please let me know if there is a better way to fix this.
Pull Request #362: Fix graceful shutdown race condition

2 of 2 new or added lines in 1 file covered. (100.0%)

2 existing lines in 2 files now uncovered.

636 of 684 relevant lines covered (92.98%)

144.42 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
1
97.01
-0.75% lib/broadway/topology.ex
1
93.33
0.48% lib/broadway/topology/terminator.ex
Jobs
ID Job ID Ran Files Coverage
1 0160e33666b8ae8fdfb245bb0ac3b8d5d0a49817-PR-362.1 30 Jul 2025 01:58PM UTC 21
92.98
GitHub Action Run
Source Files on build 0160e33666b8ae8fdfb245bb0ac3b8d5d0a49817-PR-362
  • Tree
  • List 21
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #362
  • PR Base - main (#136BEA67...)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc