File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
bitswap/client/internal/messagequeue Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -476,7 +476,7 @@ func (mq *MessageQueue) Startup() {
476476// Shutdown stops the processing of messages for a message queue.
477477func (mq * MessageQueue ) Shutdown () {
478478 mq .shutdown ()
479- mq .requests .Shutdown ()
479+ mq .requests .Close ()
480480}
481481
482482func (mq * MessageQueue ) onShutdown () {
@@ -489,6 +489,10 @@ func (mq *MessageQueue) onShutdown() {
489489 if mq .sender != nil {
490490 _ = mq .sender .Reset ()
491491 }
492+ go func () {
493+ for range mq .requests .Out {
494+ }
495+ }()
492496}
493497
494498func (mq * MessageQueue ) runRequests () {
@@ -577,7 +581,7 @@ func (mq *MessageQueue) sendMessage() {
577581 // If we fail to initialize the sender, the networking layer will
578582 // emit a Disconnect event and the MessageQueue will get cleaned up
579583 log .Infof ("Could not open message sender to peer %s: %s" , mq .p , err )
580- mq .Shutdown ()
584+ mq .shutdown ()
581585 return
582586 }
583587
@@ -608,7 +612,7 @@ func (mq *MessageQueue) sendMessage() {
608612 // If the message couldn't be sent, the networking layer will
609613 // emit a Disconnect event and the MessageQueue will get cleaned up
610614 log .Infof ("Could not send message to peer %s: %s" , mq .p , err )
611- mq .Shutdown ()
615+ mq .shutdown ()
612616 return
613617 }
614618
You can’t perform that action at this time.
0 commit comments