Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove context from dispatch #18676

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading