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() {
476
476
// Shutdown stops the processing of messages for a message queue.
477
477
func (mq * MessageQueue ) Shutdown () {
478
478
mq .shutdown ()
479
- mq .requests .Shutdown ()
479
+ mq .requests .Close ()
480
480
}
481
481
482
482
func (mq * MessageQueue ) onShutdown () {
@@ -489,6 +489,10 @@ func (mq *MessageQueue) onShutdown() {
489
489
if mq .sender != nil {
490
490
_ = mq .sender .Reset ()
491
491
}
492
+ go func () {
493
+ for range mq .requests .Out {
494
+ }
495
+ }()
492
496
}
493
497
494
498
func (mq * MessageQueue ) runRequests () {
@@ -577,7 +581,7 @@ func (mq *MessageQueue) sendMessage() {
577
581
// If we fail to initialize the sender, the networking layer will
578
582
// emit a Disconnect event and the MessageQueue will get cleaned up
579
583
log .Infof ("Could not open message sender to peer %s: %s" , mq .p , err )
580
- mq .Shutdown ()
584
+ mq .shutdown ()
581
585
return
582
586
}
583
587
@@ -608,7 +612,7 @@ func (mq *MessageQueue) sendMessage() {
608
612
// If the message couldn't be sent, the networking layer will
609
613
// emit a Disconnect event and the MessageQueue will get cleaned up
610
614
log .Infof ("Could not send message to peer %s: %s" , mq .p , err )
611
- mq .Shutdown ()
615
+ mq .shutdown ()
612
616
return
613
617
}
614
618
You can’t perform that action at this time.
0 commit comments