Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
prior, whenever the channel that would receive bfg responses in pop m…
…iner was busy, we would no-op.

this happened often because the channel was not buffered. this would happen silently as well.
add a timeout to sending messages to the non-buffered channel and log and error if we time out
  • Loading branch information
AL-CT committed Mar 19, 2025
commit 01904ac4f1fdd84c19c066e945ffe8c84f5f0925
5 changes: 3 additions & 2 deletions service/popm/popm.go
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ func (m *Miner) handleBFGCallCompletion(parrentCtx context.Context, conn *protoc

log.Tracef("handleBFGCallCompletion: %v", spew.Sdump(bc.msg))

_, _, payload, err := bfgapi.Call(ctx, conn, bc.msg)
cmd, _, payload, err := bfgapi.Call(ctx, conn, bc.msg)
if err != nil {
log.Debugf("handleBFGCallCompletion %T: %v", bc.msg, err)
select {
Expand All @@ -742,7 +742,8 @@ func (m *Miner) handleBFGCallCompletion(parrentCtx context.Context, conn *protoc
select {
case bc.ch <- payload:
log.Tracef("handleBFGCallCompletion returned: %v", spew.Sdump(payload))
default:
case <-time.After(DefaultBFGRequestTimeout):
log.Errorf("handleBFGCallCompletion: response time out %v", cmd)
}
}

Expand Down
1 change: 0 additions & 1 deletion service/popm/popm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,6 @@ func createMockBFG(ctx context.Context, t *testing.T, publicKeys []string, keyst
}

for {
time.Sleep(50 * time.Millisecond)
command, id, _, err := bfgapi.Read(ctx, conn)
if err != nil {
if !errors.Is(ctx.Err(), context.Canceled) {
Expand Down