feat: use context.Background for ScheduleCandidateParents to prevent stream breaking (#3485)
Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
parent
c463f7f63f
commit
f1dec253fc
|
|
@ -1 +1 @@
|
|||
Subproject commit 2fe844ac26afadbdee1b35f3fb7cd8e091929385
|
||||
Subproject commit 232ee8ab4631f6781ee39ff36580db0426a2c801
|
||||
|
|
@ -963,7 +963,7 @@ func (v *V2) handleRegisterPeerRequest(ctx context.Context, stream schedulerv2.S
|
|||
|
||||
// Record the start time.
|
||||
start := time.Now()
|
||||
if err := v.scheduling.ScheduleCandidateParents(ctx, peer, peer.BlockParents); err != nil {
|
||||
if err := v.scheduling.ScheduleCandidateParents(context.Background(), peer, peer.BlockParents); err != nil {
|
||||
// Collect RegisterPeerFailureCount metrics.
|
||||
metrics.RegisterPeerFailureCount.WithLabelValues(priority.String(), peer.Task.Type.String(),
|
||||
peer.Host.Type.Name()).Inc()
|
||||
|
|
@ -1042,7 +1042,7 @@ func (v *V2) handleRescheduleRequest(ctx context.Context, peerID string, candida
|
|||
|
||||
// Record the start time.
|
||||
start := time.Now()
|
||||
if err := v.scheduling.ScheduleCandidateParents(ctx, peer, peer.BlockParents); err != nil {
|
||||
if err := v.scheduling.ScheduleCandidateParents(context.Background(), peer, peer.BlockParents); err != nil {
|
||||
return status.Error(codes.FailedPrecondition, err.Error())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue