Skip to content

Commit

Permalink
Merge pull request #18676 from serathius/context-remove-2
Browse files Browse the repository at this point in the history
Remove context from dispatch
  • Loading branch information
serathius authored Oct 4, 2024
2 parents db61a6c + 7537341 commit 620a00b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions server/etcdserver/apply/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ type Result struct {
Trace *traceutil.Trace
}

type applyFunc func(ctx context.Context, r *pb.InternalRaftRequest) *Result
type applyFunc func(r *pb.InternalRaftRequest) *Result

// applierV3 is the interface for processing V3 raft messages
type applierV3 interface {
Expand Down Expand Up @@ -147,7 +147,7 @@ func newApplierV3Backend(
}

func (a *applierV3backend) Apply(r *pb.InternalRaftRequest, applyFunc applyFunc) *Result {
return applyFunc(context.TODO(), r)
return applyFunc(r)
}

func (a *applierV3backend) Put(ctx context.Context, p *pb.PutRequest) (resp *pb.PutResponse, trace *traceutil.Trace, err error) {
Expand Down
2 changes: 1 addition & 1 deletion server/etcdserver/apply/apply_auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func dummyIndexWaiter(_ uint64) <-chan struct{} {
return ch
}

func dummyApplyFunc(_ context.Context, _ *pb.InternalRaftRequest) *Result {
func dummyApplyFunc(_ *pb.InternalRaftRequest) *Result {
return &Result{}
}

Expand Down
3 changes: 2 additions & 1 deletion server/etcdserver/apply/uber_applier.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ func (a *uberApplier) Apply(r *pb.InternalRaftRequest) *Result {

// dispatch translates the request (r) into appropriate call (like Put) on
// the underlying applyV3 object.
func (a *uberApplier) dispatch(ctx context.Context, r *pb.InternalRaftRequest) *Result {
func (a *uberApplier) dispatch(r *pb.InternalRaftRequest) *Result {
ctx := context.TODO()
op := "unknown"
ar := &Result{}
defer func(start time.Time) {
Expand Down

0 comments on commit 620a00b

Please sign in to comment.