Skip to content

Fix nack deadlocks from writers - #387

Merged
philipch07 merged 2 commits into
masterfrom
pch07/fix-nack-deadlocks
Dec 2, 2025
Merged

philipch07 merged 2 commits into
masterfrom
pch07/fix-nack-deadlocks

Conversation

@philipch07

@philipch07 philipch07 commented Dec 1, 2025 •

Copy link
Copy Markdown
Member

Description

There were two deadlocks that I found from the generator and responder interceptors.

Each of these had issues from writing while holding a mutex, which could cause deadlocks. I wrote a test that hits the deadlock in the old implementation (and fails) but passes with the fix.

Note that this branch is based off of #386, so ideally that should get merged first.

Reference issue

Fixes #384

@codecov

codecov Bot commented Dec 1, 2025 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.81818% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.62%. Comparing base (8dddb51) to head (848e579).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
pkg/nack/generator_interceptor.go 78.94% 4 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #387      +/-   ##
==========================================
+ Coverage   79.45%   79.62%   +0.16%     
==========================================
  Files          84       84              
  Lines        4176     4181       +5     
==========================================
+ Hits         3318     3329      +11     
+ Misses        685      680       -5     
+ Partials      173      172       -1     
Flag Coverage Δ
go 79.62% <81.81%> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@philipch07
philipch07 force-pushed the pch07/fix-nack-deadlocks branch from c64246f to 848e579 Compare December 1, 2025 22:03

@Sean-Der Sean-Der left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love the tests :)

@JoTurk JoTurk left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it a bit, if you still want to simplify it as you told me that's fine, but i think you can just merge it as its. looks fine.

Thank you so much.

@philipch07
philipch07 merged commit 1209fc9 into master Dec 2, 2025
@philipch07
philipch07 deleted the pch07/fix-nack-deadlocks branch December 2, 2025 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Interceptor.loop() goroutine leak

3 participants