Browse Source

Merge pull request #730 from mistsys/master

fix erronous errTimedOut ("abandoned subscription...because consuming…
Evan Huus 9 years ago
parent
commit
4f47ee4924
1 changed files with 4 additions and 1 deletions
  1. 4 1
      consumer.go

+ 4 - 1
consumer.go

@@ -420,7 +420,10 @@ feederLoop:
 		msgs, child.responseResult = child.parseResponse(response)
 
 		for i, msg := range msgs {
-			expiryTimer.Reset(child.conf.Consumer.MaxProcessingTime)
+			if !expiryTimer.Reset(child.conf.Consumer.MaxProcessingTime) {
+				// expiryTimer was expired; clear out the waiting msg
+				<-expiryTimer.C
+			}
 
 			select {
 			case child.messages <- msg: