Skip to content

Commit 9e1fd70

Browse files
committed
p2p: decrease frameReadTimeout to 30s
This detects hanging connections sooner. We send a ping every 15s and other implementation have similar limits.
1 parent 1440f9a commit 9e1fd70

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

p2p/server.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ const (
2525
// Maximum number of concurrently dialing outbound connections.
2626
maxActiveDialTasks = 16
2727

28-
// maximum time allowed for reading a complete message.
29-
// this is effectively the amount of time a connection can be idle.
30-
frameReadTimeout = 1 * time.Minute
31-
// maximum amount of time allowed for writing a complete message.
28+
// Maximum time allowed for reading a complete message.
29+
// This is effectively the amount of time a connection can be idle.
30+
frameReadTimeout = 30 * time.Second
31+
32+
// Maximum amount of time allowed for writing a complete message.
3233
frameWriteTimeout = 5 * time.Second
3334
)
3435

0 commit comments

Comments
 (0)