Skip to content

Conversation

@Sean-Der
Copy link
Member

@Sean-Der Sean-Der commented Mar 7, 2019

DTLS shutdown deadlocks if Close is called before startup completes,
because the DTLS connection hasn't finished yet we don't have handles
to close anything.

This updates DTLS to follow how SCTP is shutdown, by shutting down the
nextConn (ICE in this case) we can shutdown the subsystem. By closing
ICE first, DTLS (and then SCTP) close properly no matter what state
they are in.

@Sean-Der Sean-Der added the review label Mar 7, 2019
@Sean-Der
Copy link
Member Author

Sean-Der commented Mar 7, 2019

I should have a fix soon, but wanted to make sure I had reproduce first

@Sean-Der Sean-Der marked this pull request as ready for review March 7, 2019 06:16
@Sean-Der Sean-Der requested review from backkem and kixelated March 7, 2019 06:16
time.Sleep(3 * time.Second) // TODO PeerConnection.Close() doesn't block for all subsystems
close(iceComplete)
}()
time.Sleep(3 * time.Second) // TODO PeerConnection.Close() doesn't block for all subsystems
Copy link
Member Author

Choose a reason for hiding this comment

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

This is fired in a goroutine already, I don't want users to see this and assume they need the same.


if endpoint == nil {
fmt.Printf("Warning: mux: no endpoint for packet starting with %d\n", buf[0])
muxLog.Warnf("Warning: mux: no endpoint for packet starting with %d\n", buf[0])
Copy link
Member Author

Choose a reason for hiding this comment

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

Just moving everything off of fmt.

@coveralls
Copy link

coveralls commented Mar 7, 2019

Pull Request Test Coverage Report for Build 2377

  • 5 of 5 (100.0%) changed or added relevant lines in 2 files are covered.
  • 15 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.02%) to 80.563%

Files with Coverage Reduction New Missed Lines %
lossy_stream.go 2 81.13%
dtlstransport.go 4 78.57%
peerconnection.go 9 75.67%
Totals Coverage Status
Change from base Build 2375: 0.02%
Covered Lines: 4091
Relevant Lines: 5078

💛 - Coveralls

DTLS shutdown deadlocks if Close is called before startup completes,
because the DTLS connection hasn't finished yet we don't have handles
to close anything.

This updates DTLS to follow how SCTP is shutdown, by shutting down the
nextConn (ICE in this case) we can shutdown the subsystem. By closing
ICE first, DTLS (and then SCTP) close properly no matter what state
they are in.

Resolves #487
@Sean-Der Sean-Der changed the title Add failing test for DTLS shutdown Fix deadlock in DTLS shutdown Mar 7, 2019
@backkem backkem merged commit 005c731 into master Mar 7, 2019
@backkem backkem deleted the issue-487 branch March 7, 2019 10:48
@backkem backkem removed the review label Mar 7, 2019
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.

4 participants