Skip to content

Fix deadlock on session closing - #405

Open
Hackerman-ru wants to merge 1 commit into
pion:mainfrom
Hackerman-ru:main
Open

Hackerman-ru wants to merge 1 commit into
pion:mainfrom
Hackerman-ru:main

Conversation

@Hackerman-ru

Copy link
Copy Markdown

Description

Fix a deadlock in Close(): it waits for the read loop, which can be
blocked on newStream if nobody is calling AcceptStream()

Drain newStream during shutdown and close the pending streams so the
read loop can exit. Add a regression test for this case.

@Hackerman-ru

Copy link
Copy Markdown
Author

Hello @JoTurk, can you review this pr?

@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.95%. Comparing base (508d3e9) to head (8774ba8).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #405   +/-   ##
=======================================
  Coverage   90.94%   90.95%           
=======================================
  Files          20       20           
  Lines        1491     1492    +1     
=======================================
+ Hits         1356     1357    +1     
  Misses        135      135           
Flag Coverage Δ
go 90.95% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

Comment thread session.go Outdated
@Hackerman-ru
Hackerman-ru force-pushed the main branch 2 times, most recently from 28c0454 to 9bfc540 Compare October 19, 2026 17:22
@Hackerman-ru

Copy link
Copy Markdown
Author

Hm, maybe restart Lint check?

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.

2 participants