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

panic: close of closed channel engine/peer.go:1 77 +0xb1 #34

Closed
maggch97 opened this issue Feb 25, 2024 · 7 comments
Closed

panic: close of closed channel engine/peer.go:1 77 +0xb1 #34

maggch97 opened this issue Feb 25, 2024 · 7 comments

Comments

@maggch97
Copy link

My branch is 2 years old and merged fix: #33
Not sure if the panic is caused by the fix or if the latest code has fixed this. I will update the info here if I find the root cause.

@maggch97
Copy link
Author

maggch97 commented Feb 25, 2024

2024/02/25 03:53:56 HandlePeer(rid:uid:092ae668-493f-4bf7-800a-eca1e365a31f) OnTrack(111, 702176603)
2024/02/25 04:18:03 HandlePeer(rid:uid:092ae668-493f-4bf7-800a-eca1e365a31f) OnTrack(111, 702176603) end with peer queue closed
2024/02/25 04:18:03 HandlePeer(rid:uid:CLOSED) OnTrack(111, 2389352606)
2024/02/25 04:18:03 HandlePeer(rid:uid:CLOSED) OnTrack(111, 2389352606) end with peer queue closed

@maggch97
Copy link
Author

2024/02/25 03:53:56 HandlePeer(rid:uid:092ae668-493f-4bf7-800a-eca1e365a31f) OnICEConnectionStateChange(connected)
2024/02/25 03:53:56 HandlePeer(rid:uid:092ae668-493f-4bf7-800a-eca1e365a31f) OnConnectionStateChange(connected)
2024/02/25 03:53:56 HandlePeer(rid:uid:092ae668-493f-4bf7-800a-eca1e365a31f) OnTrack(111, 702176603)
2024/02/25 03:54:27 HandlePeer(rid:uid:092ae668-493f-4bf7-800a-eca1e365a31f) OnSignalingStateChange(have-local-offer)
2024/02/25 03:54:27 HandlePeer(rid:uid:092ae668-493f-4bf7-800a-eca1e365a31f) OnSignalingStateChange(stable)
2024/02/25 04:14:11 HandlePeer(rid:uid:092ae668-493f-4bf7-800a-eca1e365a31f) OnSignalingStateChange(have-local-offer)
2024/02/25 04:14:11 HandlePeer(rid:uid:092ae668-493f-4bf7-800a-eca1e365a31f) OnSignalingStateChange(stable)
2024/02/25 04:18:03 HandlePeer(rid:uid:092ae668-493f-4bf7-800a-eca1e365a31f) OnSignalingStateChange(have-local-offer)
2024/02/25 04:18:03 HandlePeer(rid:uid:092ae668-493f-4bf7-800a-eca1e365a31f) OnSignalingStateChange(stable)
2024/02/25 04:18:03 copyTrack(rid:uid:092ae668-493f-4bf7-800a-eca1e365a31f) EOF
2024/02/25 04:18:03 HandlePeer(rid:uid:092ae668-493f-4bf7-800a-eca1e365a31f) OnTrack(111, 702176603) end with peer queue closed
2024/02/25 04:18:03 PeerClose(rid:uid:092ae668-493f-4bf7-800a-eca1e365a31f) now
2024/02/25 04:18:03 HandlePeer(rid:uid:CLOSED) OnTrack(111, 2389352606)
2024/02/25 04:18:03 PeerClose(rid:uid:CLOSED) with
2024/02/25 04:18:03 HandlePeer(rid:uid:CLOSED) OnTrack(111, 2389352606) end with peer queue closed
2024/02/25 04:18:03 PeerClose(rid:uid:CLOSED) now
2024/02/25 04:18:03 PeerClose(rid:uid:CLOSED) already

OnTrack is called when Peer is closing

@maggch97
Copy link
Author

	peer.pc.OnTrack(func(rt *webrtc.TrackRemote, receiver *webrtc.RTPReceiver) {
		if peer.cid == peerTrackClosedId {
			logger.Printf("HandlePeer(%s) OnTrack(%d, %d) closed\n", peer.id(), rt.PayloadType(), rt.SSRC())
			return
		}

an adhoc fix

@maggch97
Copy link
Author

The current design of OnTrack require this function can only be called once

@cedricfung
Copy link
Contributor

Thank you. Can you submit a PR for this fix?

@maggch97
Copy link
Author

Thank you. Can you submit a PR for this fix?

Above adhoc fix is not work, currently I just add a recover in copyTrack. If I found a good solution later, I will creat a PR.

@cedricfung
Copy link
Contributor

Fixed ce7ec29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants