Skip to content

Commit

Permalink
Merge pull request #136 from spenczar/fix_workermanager_memory_leak
Browse files Browse the repository at this point in the history
Allocate a new taskBatch for each batch of tasks in the WorkerManager
  • Loading branch information
serejja committed Jul 17, 2015
2 parents 806cde9 + 83504cf commit 41834bc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions workers.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ func (wm *WorkerManager) Stop() chan bool {

func (wm *WorkerManager) startBatch(batch []*Message) {
inLock(&wm.stopLock, func() {
wm.currentBatch = newTaskBatch()
wm.batchOrder = make([]TaskId, 0)
for _, message := range batch {
topicPartition := TopicAndPartition{message.Topic, message.Partition}
Expand Down

0 comments on commit 41834bc

Please sign in to comment.