-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
DataChannel.OnOpen() fires before ACK is received #1063
Comments
@jwhited Thanks for the report! I don't think the issue is specific to detached, but maybe just timing related. The fix is that we shouldn't consider the channel Open until channelAck is processed. We should then add a I think it is great first task @jwhited and happy to help you get it merged. If you don't have the bandwidth I can fix it right now though! Shouldn't take me more then 30 mins |
I'll give it a shot @Sean-Der |
Hey @jwhited Anyway I can help with this? If you don't have the bandwidth I am happy to take it on |
@Sean-Der ended up moving to a reliable dataChannel design for other reasons and this is no longer an issue due to timing changes and/or retrans. I may not have time in the short term to get a PR in, feel free fix it |
I'm coming across this too (and I'm not using detached channels). Is it because of the lack or ordering or lack of reliability (or both)? |
heh, pion/datachannel DataChannel.handleDCEP has a TODO for channelAck: referencing https://tools.ietf.org/html/draft-ietf-rtcweb-data-protocol-09#section-5.2. Note that messages may be sent before before ACK is received, but must be sent ordered. also as part of this: SCTPTransport.acceptDataChannels triggers OnError, but nothing is subscribed to it (and external parties can't because pion/webrtc DataChannel.Transport() returns nil). |
@Sean-Der any movement on this? |
@Sean-Der We came across this as well. We will try the sleep workaround, however, this does not seem right through. Is there any movement on this issue? We are in the process of migrating to v2 (we tested v3 as well, but it does not work as well). Is there a better workaround currently? We are actually doing the exact same stuff like in the issue, we send data on OnData() and we get: However, it is actually sufficient that the browser sends this message, so using a sleep might not work on the Go side. :-( Any thoughts on this? |
Ok, we found something. We were using negotiated channels, using OnDataChannel, this bug does not occur. Maybe that helps :-). |
I'm seeing this issue with webrtc v3.0.11. Has this been fixed in an upcoming version of datachannel? I noticed commit cc39fb6310540b11169368f4df9badc332f1a46a in datachannel removed the TODO about handling the channel ACK, but it's not clear to me that anything actually changed as far as handling a channel ACK. webrtc v3.0.11 uses datachannel v1.4.21, which is older than that commit. |
Can also report seeing this issue in 3.0.11. I can reproduce it about 2.5% of the time in tests. |
This bug prevents me from using unordered channels and ultimately improving the performance of our application. @Sean-Der are you able to summarise how one would go about triaging and finding out where the issue lies? |
This bug also is preventing me from using unordered channels |
Add a OnChannelOpen handler. This allows us to fire OnOpen messages correctly in pion/webrtc Fixes pion#81 Relates to pion/webrtc#1063
Add a OnOpenComplete handler. This allows us to fire OnOpen messages correctly in pion/webrtc Fixes pion#81 Relates to pion/webrtc#1063
Add a OnOpenComplete handler. This allows us to fire OnOpen messages correctly in pion/webrtc Fixes pion#81 Relates to pion/webrtc#1063
Add a OnOpenComplete handler. This allows us to fire OnOpen messages correctly in pion/webrtc Fixes pion#81 Relates to pion/webrtc#1063
Add a OnOpenComplete handler. This allows us to fire OnOpen messages correctly in pion/webrtc Fixes #81 Relates to pion/webrtc#1063
Using an improvment of pion/datachannel, the channel opener can now set an event to be called when the DATA_CHANNEL_ACK message is recieved Resolves pion#1063 Relates to pion/datachannel#81
Using an improvment of pion/datachannel, the channel opener can now set an event to be called when the DATA_CHANNEL_ACK message is recieved Resolves pion#1063 Relates to pion/datachannel#81
Using an improvment of pion/datachannel, the channel opener can now set an event to be called when the DATA_CHANNEL_ACK message is recieved Resolves pion#1063 Relates to pion/datachannel#81
Using an improvment of pion/datachannel, the channel opener can now set an event to be called when the DATA_CHANNEL_ACK message is recieved Resolves pion#1063 Relates to pion/datachannel#81
Using an improvment of pion/datachannel, the channel opener can now set an event to be called when the DATA_CHANNEL_ACK message is recieved Resolves pion#1063 Relates to pion/datachannel#81
Using an improvment of pion/datachannel, the channel opener can now set an event to be called when the DATA_CHANNEL_ACK message is recieved Resolves #1063 Relates to pion/datachannel#81
Using an improvment of pion/datachannel, the channel opener can now set an event to be called when the DATA_CHANNEL_ACK message is recieved Resolves pion#1063 Relates to pion/datachannel#81
Using an improvment of pion/datachannel, the channel opener can now set an event to be called when the DATA_CHANNEL_ACK message is recieved Resolves pion#1063 Relates to pion/datachannel#81
Using an improvment of pion/datachannel, the channel opener can now set an event to be called when the DATA_CHANNEL_ACK message is recieved Resolves pion#1063 Relates to pion/datachannel#81
Your environment.
Both peers are Pion
What did you do?
Opened a DataChannel between two peers and wrote data to it from the dialing side once DataChannel.OnOpen() fired. A
SettingEngine
withDetachDataChannels()
is being used on both sides.Dialing side:
What did you expect?
Data was transported successfully
What happened?
The remote side dropped the data and the following was logged:
If I add a 1s sleep in OnOpen() before writing there are no issues
Based on discussion in Slack there is an assumption that this bug is specific to the use of the SettingEngine.DetachDataChannels(), but I haven't confirmed this yet.
The text was updated successfully, but these errors were encountered: