Skip to content

Commit 33158af

Browse files
committed
human check: RunBeforeDeadline ctx + error message
1 parent 752953c commit 33158af

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

client/protocol/submitter.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,14 +343,14 @@ func (s *SignatureSubmitter) RunEpochBeforeDeadline(ctx context.Context, round i
343343

344344
finished := make(chan int, len(s.subProtocols))
345345

346-
ctx, cancel := context.WithTimeout(ctx, deadline)
346+
deadlineCtx, cancel := context.WithTimeout(ctx, deadline)
347347

348348
for i, protocol := range s.subProtocols {
349349
protocolsToQuery[i] = true
350350

351351
go func() {
352352
response := protocol.fetchDataWithRetry(
353-
ctx,
353+
deadlineCtx,
354354
round,
355355
"submitSignatures",
356356
s.protocolContext.submitSignaturesAddress.Hex(),
@@ -409,7 +409,7 @@ func (s *SignatureSubmitter) RunEpochBeforeDeadline(ctx context.Context, round i
409409
}
410410
default:
411411
select {
412-
case <-ctx.Done():
412+
case <-deadlineCtx.Done():
413413
logger.Debugf("Tx for submitter %s for round %v triggered by the deadline", s.name, round)
414414
readyToSend = true
415415
case i := <-finished:

client/runner/runner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func RunAsync(ctx context.Context, cancel context.CancelFunc, wg *sync.WaitGroup
2727
wg.Go(func() {
2828
err := r.Run(ctx)
2929
if err != nil {
30-
logger.Errorf("Unexpected error, terminating: %v", err)
30+
logger.Errorf("Stopping: %v", err)
3131
cancel()
3232
}
3333
})

0 commit comments

Comments
 (0)