Skip to content

Commit f1dec25

Browse files
authored
feat: use context.Background for ScheduleCandidateParents to prevent stream breaking (#3485)
Signed-off-by: Gaius <gaius.qi@gmail.com>
1 parent c463f7f commit f1dec25

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

client-rs

Submodule client-rs updated 50 files

scheduler/service/service_v2.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ func (v *V2) handleRegisterPeerRequest(ctx context.Context, stream schedulerv2.S
963963

964964
// Record the start time.
965965
start := time.Now()
966-
if err := v.scheduling.ScheduleCandidateParents(ctx, peer, peer.BlockParents); err != nil {
966+
if err := v.scheduling.ScheduleCandidateParents(context.Background(), peer, peer.BlockParents); err != nil {
967967
// Collect RegisterPeerFailureCount metrics.
968968
metrics.RegisterPeerFailureCount.WithLabelValues(priority.String(), peer.Task.Type.String(),
969969
peer.Host.Type.Name()).Inc()
@@ -1042,7 +1042,7 @@ func (v *V2) handleRescheduleRequest(ctx context.Context, peerID string, candida
10421042

10431043
// Record the start time.
10441044
start := time.Now()
1045-
if err := v.scheduling.ScheduleCandidateParents(ctx, peer, peer.BlockParents); err != nil {
1045+
if err := v.scheduling.ScheduleCandidateParents(context.Background(), peer, peer.BlockParents); err != nil {
10461046
return status.Error(codes.FailedPrecondition, err.Error())
10471047
}
10481048

0 commit comments

Comments
 (0)