Closed murat-dogan closed 3 years ago
There are two different buffers at play here: the send queue, whose size is reported as buffered amount, and the lower-level SCTP buffer. The SCTP dry event indicates the SCTP buffer is empty, which should trigger taking messages from the send queue and passing them to the SCTP layer.
Since this is not happening, I guess there are two possibilities: the send queue is actually empty or there is a deadlock somewhere when sending. The last SCTP send in the log was successful, meaning the send queue has been emptied, so I would guess SCTP might have actually sent everything but the reported buffered amount could be wrong.
What is SendBufferAmount
in the log?
SendBufferAmount is the size of the send queue, which is reported from Datachannel.
Does it take a value different from 16000? Also is 16000 the value of BUFFER_SIZE
in your run? (it is 10000 in client-benchmark.js
)
Yes it is changing. Normally app is adding message till 11000 but it was 16000 when this happened.
It seems it is reporting wrongly. I checked mSendQueue.size()
. It was 0 but bufferedAmount
was reporting 11000.
Please note that; This is happening sometimes after 2 minutes, sometimes after 30 minutes.
For some reason the buffered amount callback was not synchronized properly. Could you please test if https://github.com/paullouisageneau/libdatachannel/pull/353 fixes the issue?
I am re-running test. It has been nearly 1 hour without any issue ! And buffer size is always <= 11000 which should be.
I ended first test after 1 hour. Everything was ok. This is from my second test
665# Sent: 52713 KB/s Received: 2092 KB/s SendBufferAmount: 11000 DataChannelOpen: true
666# Sent: 54496 KB/s Received: 5054 KB/s SendBufferAmount: 11000 DataChannelOpen: true
667# Sent: 49151 KB/s Received: 4470 KB/s SendBufferAmount: 11000 DataChannelOpen: true
668# Sent: 56346 KB/s Received: 6775 KB/s SendBufferAmount: 0 DataChannelOpen: true
669# Sent: 51448 KB/s Received: 6243 KB/s SendBufferAmount: 11000 DataChannelOpen: true
670# Sent: 63698 KB/s Received: 5758 KB/s SendBufferAmount: 0 DataChannelOpen: true
671# Sent: 53489 KB/s Received: 4153 KB/s SendBufferAmount: 0 DataChannelOpen: true
672# Sent: 50665 KB/s Received: 4948 KB/s SendBufferAmount: 11000 DataChannelOpen: true
673# Sent: 50763 KB/s Received: 4423 KB/s SendBufferAmount: 0 DataChannelOpen: true
674# Sent: 50361 KB/s Received: 5575 KB/s SendBufferAmount: 11000 DataChannelOpen: true
675# Sent: 46681 KB/s Received: 10386 KB/s SendBufferAmount: 0 DataChannelOpen: true
676# Sent: 49342 KB/s Received: 9570 KB/s SendBufferAmount: 11000 DataChannelOpen: true
677# Sent: 54762 KB/s Received: 6852 KB/s SendBufferAmount: 11000 DataChannelOpen: true
678# Sent: 58553 KB/s Received: 4739 KB/s SendBufferAmount: 0 DataChannelOpen: true
679# Sent: 52728 KB/s Received: 4145 KB/s SendBufferAmount: 11000 DataChannelOpen: true
680# Sent: 60951 KB/s Received: 6341 KB/s SendBufferAmount: 11000 DataChannelOpen: true
681# Sent: 48848 KB/s Received: 7965 KB/s SendBufferAmount: 0 DataChannelOpen: true
682# Sent: 49238 KB/s Received: 7090 KB/s SendBufferAmount: 11000 DataChannelOpen: true
683# Sent: 49735 KB/s Received: 7273 KB/s SendBufferAmount: 11000 DataChannelOpen: true
684# Sent: 48099 KB/s Received: 7858 KB/s SendBufferAmount: 11000 DataChannelOpen: true
685# Sent: 55176 KB/s Received: 6599 KB/s SendBufferAmount: 0 DataChannelOpen: true
686# Sent: 44634 KB/s Received: 4563 KB/s SendBufferAmount: 11000 DataChannelOpen: true
687# Sent: 53916 KB/s Received: 7717 KB/s SendBufferAmount: 0 DataChannelOpen: true
688# Sent: 58921 KB/s Received: 7976 KB/s SendBufferAmount: 0 DataChannelOpen: true
689# Sent: 52233 KB/s Received: 6630 KB/s SendBufferAmount: 5000 DataChannelOpen: true
690# Sent: 44727 KB/s Received: 3446 KB/s SendBufferAmount: 11000 DataChannelOpen: true
691# Sent: 50961 KB/s Received: 9301 KB/s SendBufferAmount: 0 DataChannelOpen: true
692# Sent: 56286 KB/s Received: 11005 KB/s SendBufferAmount: 0 DataChannelOpen: true
693# Sent: 59328 KB/s Received: 8656 KB/s SendBufferAmount: 0 DataChannelOpen: true
694# Sent: 53216 KB/s Received: 7653 KB/s SendBufferAmount: 0 DataChannelOpen: true
695# Sent: 48889 KB/s Received: 8984 KB/s SendBufferAmount: 11000 DataChannelOpen: true
696# Sent: 52912 KB/s Received: 8980 KB/s SendBufferAmount: 0 DataChannelOpen: true
697# Sent: 56620 KB/s Received: 12356 KB/s SendBufferAmount: 0 DataChannelOpen: true
698# Sent: 51447 KB/s Received: 7052 KB/s SendBufferAmount: 0 DataChannelOpen: true
699# Sent: 50047 KB/s Received: 3364 KB/s SendBufferAmount: 11000 DataChannelOpen: true
700# Sent: 49913 KB/s Received: 8396 KB/s SendBufferAmount: 0 DataChannelOpen: true
701# Sent: 55505 KB/s Received: 8764 KB/s SendBufferAmount: 4000 DataChannelOpen: true
702# Sent: 62590 KB/s Received: 8634 KB/s SendBufferAmount: 0 DataChannelOpen: true
703# Sent: 48072 KB/s Received: 4043 KB/s SendBufferAmount: 11000 DataChannelOpen: true
704# Sent: 52470 KB/s Received: 5020 KB/s SendBufferAmount: 11000 DataChannelOpen: true
705# Sent: 49179 KB/s Received: 6331 KB/s SendBufferAmount: 0 DataChannelOpen: true
706# Sent: 46180 KB/s Received: 10180 KB/s SendBufferAmount: 11000 DataChannelOpen: true
707# Sent: 44293 KB/s Received: 10838 KB/s SendBufferAmount: 0 DataChannelOpen: true
708# Sent: 47146 KB/s Received: 6291 KB/s SendBufferAmount: 11000 DataChannelOpen: true
709# Sent: 52563 KB/s Received: 3104 KB/s SendBufferAmount: 11000 DataChannelOpen: true
710# Sent: 65332 KB/s Received: 8088 KB/s SendBufferAmount: 0 DataChannelOpen: true
711# Sent: 46825 KB/s Received: 9234 KB/s SendBufferAmount: 11000 DataChannelOpen: true
712# Sent: 47833 KB/s Received: 7323 KB/s SendBufferAmount: 11000 DataChannelOpen: true
713# Sent: 51469 KB/s Received: 6677 KB/s SendBufferAmount: 0 DataChannelOpen: true
714# Sent: 52297 KB/s Received: 11977 KB/s SendBufferAmount: 0 DataChannelOpen: true
715# Sent: 44305 KB/s Received: 10500 KB/s SendBufferAmount: 11000 DataChannelOpen: true
716# Sent: 54151 KB/s Received: 11579 KB/s SendBufferAmount: 0 DataChannelOpen: true
717# Sent: 47631 KB/s Received: 9027 KB/s SendBufferAmount: 0 DataChannelOpen: true
718# Sent: 51892 KB/s Received: 6917 KB/s SendBufferAmount: 11000 DataChannelOpen: true
719# Sent: 50940 KB/s Received: 7317 KB/s SendBufferAmount: 11000 DataChannelOpen: true
720# Sent: 48218 KB/s Received: 7991 KB/s SendBufferAmount: 0 DataChannelOpen: true
721# Sent: 50590 KB/s Received: 11331 KB/s SendBufferAmount: 0 DataChannelOpen: true
722# Sent: 48442 KB/s Received: 8755 KB/s SendBufferAmount: 11000 DataChannelOpen: true
723# Sent: 46541 KB/s Received: 10452 KB/s SendBufferAmount: 11000 DataChannelOpen: true
724# Sent: 51258 KB/s Received: 7134 KB/s SendBufferAmount: 0 DataChannelOpen: true
725# Sent: 52545 KB/s Received: 7949 KB/s SendBufferAmount: 0 DataChannelOpen: true
726# Sent: 51085 KB/s Received: 7688 KB/s SendBufferAmount: 11000 DataChannelOpen: true
727# Sent: 61557 KB/s Received: 4713 KB/s SendBufferAmount: 0 DataChannelOpen: true
728# Sent: 52822 KB/s Received: 5205 KB/s SendBufferAmount: 11000 DataChannelOpen: true
It seems like fix is working. Thanks.
Great, I'm merging it.
The fix is in version 0.11.7!
I am trying to setup a benchmark test for
node-datachannel
. Please check here for code sample; https://github.com/murat-dogan/node-datachannel/blob/master/examples/client-server/client-benchmark.jsI am waiting
onBufferedAmountLow
event to be fired for sending more data but at some point event never fires. As you see from log belowSCTP dry event
fires, send buffer is full but SCTP level is not sending data.I also checked ICE log message
Integrity check failed - bad request.
and it seems harmless.For whole log please visit https://pastebin.ubuntu.com/p/gYVzwGSKjK/