Skip to content

Commit

Permalink
testing: get goroutines from sweeper when deadlocked at shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
aakselrod committed Nov 20, 2024
1 parent 38f1237 commit c9dca65
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions sweep/sweeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package sweep
import (
"errors"
"fmt"
"runtime"
"sync"
"sync/atomic"

Expand Down Expand Up @@ -1624,14 +1625,25 @@ func (s *UtxoSweeper) monitorFeeBumpResult(resultChan <-chan *BumpResult) {
}

case <-s.quit:
log.Debugf("Sweeper shutting down, exit fee " +
"bump handler")
log.Debugf("Sweeper shutting down, exit fee "+
"bump handler: %s", stack())

return
}
}
}

func stack() []byte {
buf := make([]byte, 1024)
for {
n := runtime.Stack(buf, true)
if n < len(buf) {
return buf[:n]
}
buf = make([]byte, 2*len(buf))
}
}

// handleBumpEventTxFailed handles the case where the tx has been failed to
// publish.
func (s *UtxoSweeper) handleBumpEventTxFailed(r *BumpResult) error {
Expand Down

0 comments on commit c9dca65

Please sign in to comment.