Skip to content

Commit

Permalink
GOCBC-72: Use a larger channel for bulk op signalling.
Browse files Browse the repository at this point in the history
We were encountering a situation where the bulk op execute's were
getting stuck waiting for room in the pipeline, but the pipeline
could not proceed because a previous op was blocking on the signal
channel which wasn't yet being read from.

Change-Id: I7bb01f759c61411a33bb659880ccaa17a777b174
Reviewed-on: http://review.couchbase.org/57124
Tested-by: Brett Lawson <brett19@gmail.com>
Reviewed-by: Mark Nunberg <mark.nunberg@couchbase.com>
  • Loading branch information
brett19 committed Nov 17, 2015
1 parent cd61123 commit c10d5a8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bucket_multi.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ type BulkOp interface {
func (b *Bucket) Do(ops []BulkOp) error {
timeoutTmr := gocbcore.AcquireTimer(time.Second * 10)

signal := make(chan BulkOp, 1)
// Make the channel big enough to hold all our ops in case
// we get delayed inside execute (don't want to block the
// individual op handlers when they dispatch their signal).
signal := make(chan BulkOp, len(ops))
for _, item := range ops {
item.execute(b, signal)
}
Expand Down

0 comments on commit c10d5a8

Please sign in to comment.