瀏覽代碼

Fix abort()

Add a missing return, and zero out the subscriptions when we're done.
Evan Huus 10 年之前
父節點
當前提交
9d4ca029b1
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      offset_manager.go

+ 3 - 0
offset_manager.go

@@ -392,6 +392,7 @@ func (bom *brokerOffsetManager) flushToBroker() {
 
 	if err != nil {
 		bom.abort(err)
+		return
 	}
 
 	for s := range bom.subscriptions {
@@ -463,4 +464,6 @@ func (bom *brokerOffsetManager) abort(err error) {
 			s.rebalance <- none{}
 		}
 	}
+
+	bom.subscriptions = make(map[*partitionOffsetManager]none)
 }