Skip to content

Commit

Permalink
increase queue length
Browse files Browse the repository at this point in the history
  • Loading branch information
sukunrt committed Dec 17, 2023
1 parent ee4b066 commit 0cd1d97
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 2 additions & 0 deletions go.mod
Expand Up @@ -130,3 +130,5 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
lukechampine.com/blake3 v1.2.1 // indirect
)

replace github.com/pion/sctp => github.com/sukunrt/sctp v0.0.0-20231217055423-1ff4ca21cc89
6 changes: 2 additions & 4 deletions go.sum
Expand Up @@ -419,10 +419,6 @@ github.com/pion/rtcp v1.2.13/go.mod h1:sn6qjxvnwyAkkPzPULIbVqSKI5Dv54Rv7VG0kNxh9
github.com/pion/rtp v1.8.2/go.mod h1:pBGHaFt/yW7bf1jjWAoUjpSNoDnw98KTMg+jWWvziqU=
github.com/pion/rtp v1.8.3 h1:VEHxqzSVQxCkKDSHro5/4IUUG1ea+MFdqR2R3xSpNU8=
github.com/pion/rtp v1.8.3/go.mod h1:pBGHaFt/yW7bf1jjWAoUjpSNoDnw98KTMg+jWWvziqU=
github.com/pion/sctp v1.8.5/go.mod h1:SUFFfDpViyKejTAdwD1d/HQsCu+V/40cCs2nZIvC3s0=
github.com/pion/sctp v1.8.8/go.mod h1:igF9nZBrjh5AtmKc7U30jXltsFHicFCXSmWA2GWRaWs=
github.com/pion/sctp v1.8.9 h1:TP5ZVxV5J7rz7uZmbyvnUvsn7EJ2x/5q9uhsTtXbI3g=
github.com/pion/sctp v1.8.9/go.mod h1:cMLT45jqw3+jiJCrtHVwfQLnfR0MGZ4rgOJwUOIqLkI=
github.com/pion/sdp/v3 v3.0.6 h1:WuDLhtuFUUVpTfus9ILC4HRyHsW6TdugjEX/QY9OiUw=
github.com/pion/sdp/v3 v3.0.6/go.mod h1:iiFWFpQO8Fy3S5ldclBkpXqmWy02ns78NOKoLLL0YQw=
github.com/pion/srtp/v2 v2.0.18 h1:vKpAXfawO9RtTRKZJbG4y0v1b11NZxQnxRl85kGuUlo=
Expand Down Expand Up @@ -547,6 +543,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/sukunrt/sctp v0.0.0-20231217055423-1ff4ca21cc89 h1:zokP7P0INq/718Yj0AJu7gpN64eNfjWCeYVx9/JBE6M=
github.com/sukunrt/sctp v0.0.0-20231217055423-1ff4ca21cc89/go.mod h1:cMLT45jqw3+jiJCrtHVwfQLnfR0MGZ4rgOJwUOIqLkI=
github.com/syndtr/goleveldb v1.0.0 h1:fBdIW9lB4Iz0n9khmH8w27SJ3QEJ7+IgjPEwGSZiFdE=
github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ=
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
Expand Down
10 changes: 4 additions & 6 deletions p2p/test/transport/transport_test.go
Expand Up @@ -9,7 +9,6 @@ import (
"io"
"net"
"runtime"
"strings"
"sync"
"sync/atomic"
"testing"
Expand Down Expand Up @@ -379,9 +378,6 @@ func TestMoreStreamsThanOurLimits(t *testing.T) {
const streamCount = 1024
for _, tc := range transportsToTest {
t.Run(tc.Name, func(t *testing.T) {
if strings.Contains(tc.Name, "WebRTC") {
t.Skip("This test potentially exhausts the uint16 WebRTC stream ID space.")
}
listenerLimits := rcmgr.PartialLimitConfig{
PeerDefault: rcmgr.ResourceLimits{
Streams: 32,
Expand Down Expand Up @@ -422,7 +418,7 @@ func TestMoreStreamsThanOurLimits(t *testing.T) {
var completedStreams atomic.Int32

const maxWorkerCount = streamCount
workerCount := 4
workerCount := 16

var startWorker func(workerIdx int)
startWorker = func(workerIdx int) {
Expand All @@ -437,7 +433,9 @@ func TestMoreStreamsThanOurLimits(t *testing.T) {
// Inline function so we can use defer
func() {
var didErr bool
defer completedStreams.Add(1)
defer func() {
fmt.Println("completed: ", completedStreams.Add(1))
}()
defer func() {
// Only the first worker adds more workers
if workerIdx == 0 && !didErr && !sawFirstErr.Load() {
Expand Down
3 changes: 3 additions & 0 deletions p2p/transport/webrtc/connection.go
Expand Up @@ -8,6 +8,7 @@ import (
"net"
"sync"
"sync/atomic"
"time"

ic "github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/network"
Expand Down Expand Up @@ -176,6 +177,7 @@ func (c *connection) OpenStream(ctx context.Context) (network.MuxedStream, error
str.Reset()
return nil, fmt.Errorf("failed to add stream(%d) to connection: %w", streamID, err)
}
fmt.Println(time.Now(), "stream opened", str.id)
return str, nil
}

Expand All @@ -189,6 +191,7 @@ func (c *connection) AcceptStream() (network.MuxedStream, error) {
str.Reset()
return nil, err
}
fmt.Println(time.Now(), "stream accepted", str.id)
return str, nil
}
}
Expand Down

0 comments on commit 0cd1d97

Please sign in to comment.