Skip to content

Commit

Permalink
feat: use context.Background for ScheduleCandidateParents to prevent …
Browse files Browse the repository at this point in the history
…stream breaking (#3485)

Signed-off-by: Gaius <[email protected]>
  • Loading branch information
gaius-qi authored Sep 6, 2024
1 parent c463f7f commit f1dec25
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client-rs
Submodule client-rs updated 50 files
+30 −7 .github/workflows/release.yml
+29 −16 Cargo.lock
+11 −10 Cargo.toml
+7 −6 ci/Dockerfile
+6 −4 ci/Dockerfile.dfinit
+1 −0 dragonfly-client-backend/Cargo.toml
+6 −1 dragonfly-client-backend/src/http.rs
+132 −16 dragonfly-client-backend/src/lib.rs
+141 −103 dragonfly-client-backend/src/object_storage.rs
+6 −1 dragonfly-client-config/src/dfdaemon.rs
+2 −1 dragonfly-client-config/src/dfinit.rs
+1 −0 dragonfly-client-init/src/bin/main.rs
+5 −1 dragonfly-client-init/src/container_runtime/containerd.rs
+3 −1 dragonfly-client-init/src/container_runtime/crio.rs
+3 −1 dragonfly-client-init/src/container_runtime/docker.rs
+4 −1 dragonfly-client-init/src/container_runtime/mod.rs
+13 −1 dragonfly-client-storage/src/content.rs
+35 −1 dragonfly-client-storage/src/lib.rs
+73 −11 dragonfly-client-storage/src/metadata.rs
+11 −1 dragonfly-client-storage/src/storage_engine/rocksdb.rs
+1 −1 dragonfly-client-util/Cargo.toml
+2 −0 dragonfly-client-util/src/digest/mod.rs
+9 −1 dragonfly-client-util/src/http/mod.rs
+8 −0 dragonfly-client-util/src/id_generator/mod.rs
+7 −0 dragonfly-client-util/src/tls/mod.rs
+2 −1 dragonfly-client/Cargo.toml
+6 −1 dragonfly-client/src/announcer/mod.rs
+1 −0 dragonfly-client/src/bin/dfcache/main.rs
+5 −4 dragonfly-client/src/bin/dfdaemon/main.rs
+24 −34 dragonfly-client/src/bin/dfget/main.rs
+1 −0 dragonfly-client/src/bin/dfstore/main.rs
+6 −1 dragonfly-client/src/dynconfig/mod.rs
+11 −1 dragonfly-client/src/gc/mod.rs
+7 −3 dragonfly-client/src/grpc/dfdaemon_download.rs
+22 −11 dragonfly-client/src/grpc/dfdaemon_upload.rs
+3 −0 dragonfly-client/src/grpc/health.rs
+2 −0 dragonfly-client/src/grpc/manager.rs
+7 −6 dragonfly-client/src/grpc/mod.rs
+4 −0 dragonfly-client/src/grpc/scheduler.rs
+2 −0 dragonfly-client/src/grpc/security.rs
+4 −1 dragonfly-client/src/health/mod.rs
+5 −1 dragonfly-client/src/metrics/mod.rs
+6 −1 dragonfly-client/src/proxy/header.rs
+77 −23 dragonfly-client/src/proxy/mod.rs
+14 −2 dragonfly-client/src/resource/cache_task.rs
+1 −0 dragonfly-client/src/resource/piece.rs
+3 −1 dragonfly-client/src/resource/piece_collector.rs
+45 −10 dragonfly-client/src/resource/task.rs
+5 −1 dragonfly-client/src/stats/mod.rs
+16 −2 dragonfly-client/src/tracing/mod.rs
4 changes: 2 additions & 2 deletions scheduler/service/service_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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())
}

Expand Down

0 comments on commit f1dec25

Please sign in to comment.