Skip to content

Commit

Permalink
Default m3msg write timeouts to 5 seconds (#2698)
Browse files Browse the repository at this point in the history
This changes both the Producer sending new messages and the Consumer
sending ack messages.

5s is a safer default to prevent infinite blocking if the TCP connection
is not currently available for writing (i.e the buffer is full).
  • Loading branch information
ryanhall07 authored Oct 6, 2020
1 parent 47c219a commit b524acb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/msg/consumer/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ var (
defaultAckBufferSize = 1048576
defaultAckFlushInterval = 200 * time.Millisecond
defaultConnectionBufferSize = 1048576
// TODO(ryanhall07): set this to 5s once we verify this works.
defaultWriteTimeout = 0 * time.Second
defaultWriteTimeout = 5 * time.Second
)

type options struct {
Expand Down
2 changes: 1 addition & 1 deletion src/msg/producer/writer/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const (

defaultNumConnections = 4
defaultConnectionDialTimeout = 5 * time.Second
defaultConnectionWriteTimeout = time.Duration(0)
defaultConnectionWriteTimeout = 5 * time.Second
defaultConnectionKeepAlivePeriod = 5 * time.Second
defaultConnectionResetDelay = 2 * time.Second
defaultConnectionFlushInterval = time.Second
Expand Down

0 comments on commit b524acb

Please sign in to comment.