Skip to content

Commit

Permalink
Increase writeRequestsCh channel buffer size (apache#277)
Browse files Browse the repository at this point in the history
* Increase writeRequestsCh channel buffer size

* Fixed indentation
  • Loading branch information
merlimat authored Jun 11, 2020
1 parent c979046 commit 90307f2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pulsar/internal/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,15 @@ func newConnection(logicalAddr *url.URL, physicalAddr *url.URL, tlsOptions *TLSO
closeCh: make(chan interface{}),
incomingRequestsCh: make(chan *request, 10),
incomingCmdCh: make(chan *incomingCmd, 10),
writeRequestsCh: make(chan []byte, 10),
listeners: make(map[uint64]ConnectionListener),
consumerHandlers: make(map[uint64]ConsumerHandler),

// This channel is used to pass data from producers to the connection
// go routine. It can become contended or blocking if we have multiple
// partition produces writing on a single connection. In general it's
// good to keep this above the number of partition producers assigned
// to a single connection.
writeRequestsCh: make(chan []byte, 256),
listeners: make(map[uint64]ConnectionListener),
consumerHandlers: make(map[uint64]ConsumerHandler),
}
cnx.reader = newConnectionReader(cnx)
cnx.cond = sync.NewCond(cnx)
Expand Down

0 comments on commit 90307f2

Please sign in to comment.