Skip to content
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

Add PeerConnection.GracefulClose #2847

Merged
merged 1 commit into from
Aug 6, 2024
Merged

Conversation

edaniels
Copy link
Member

@edaniels edaniels commented Aug 2, 2024

Take 2: This is a more thorough attempt at closing gracefully. If anything, every path that graceful touches becomes opt-in, so it shouldn't affect any existing users and it makes it safe for backporting.

GracefulClose/Stop added to:

  • PeerConnection
  • DataChannel
  • ICEGatherer
  • ICETransport
  • operations

@edaniels edaniels requested a review from Sean-Der August 2, 2024 16:29
Copy link

codecov bot commented Aug 2, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 8 lines in your changes missing coverage. Please review.

Project coverage is 65.11%. Comparing base (dbe26d3) to head (93ac274).

Files Patch % Lines
operations.go 80.00% 5 Missing and 1 partial ⚠️
internal/mux/mux.go 0.00% 2 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (dbe26d3) and HEAD (93ac274). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (dbe26d3) HEAD (93ac274)
go 2 0
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #2847       +/-   ##
===========================================
- Coverage   78.94%   65.11%   -13.84%     
===========================================
  Files          89       67       -22     
  Lines        8335     3262     -5073     
===========================================
- Hits         6580     2124     -4456     
+ Misses       1278     1011      -267     
+ Partials      477      127      -350     
Flag Coverage Δ
go ?
wasm 65.11% <75.00%> (+0.03%) ⬆️

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.

@edaniels edaniels force-pushed the graceful_close branch 4 times, most recently from cff4dd3 to 9dc532b Compare August 2, 2024 16:48
@edaniels
Copy link
Member Author

edaniels commented Aug 2, 2024

First test run had #2848 but verified it happens on master

peerconnection.go Outdated Show resolved Hide resolved
datachannel.go Outdated Show resolved Hide resolved
@edaniels edaniels requested a review from Sean-Der August 4, 2024 21:14
@edaniels edaniels force-pushed the graceful_close branch 2 times, most recently from a77c5e7 to f057900 Compare August 5, 2024 15:40
@edaniels
Copy link
Member Author

edaniels commented Aug 5, 2024

@Sean-Der this now depends on pion/ice#718. Tests will fail with peerconnection_close_test.go:237: the agent is closed in the meantime since we can't doubly close the agent.

@@ -129,6 +129,10 @@ func (m *Mux) readLoop() {
}

if err = m.dispatch(buf[:n]); err != nil {
if errors.Is(err, io.ErrClosedPipe) {
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't see a reason to have this spuriously log when we are the ones closing the packetio.Buffer.

@edaniels edaniels merged commit 78c8a2e into pion:master Aug 6, 2024
16 of 17 checks passed
@edaniels edaniels deleted the graceful_close branch August 6, 2024 13:51
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