-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
[3.5] server: don't panic in readonly serializable txn #14178
Conversation
PR isn't merged yet, but even if solution changes, I think test is relevant |
e874e60
to
ceda863
Compare
server/etcdserver/apply.go
Outdated
@@ -474,7 +475,17 @@ func (a *applierV3backend) Txn(ctx context.Context, rt *pb.TxnRequest) (*pb.TxnR | |||
txn.End() | |||
txn = a.s.KV().Write(trace) | |||
} | |||
a.applyTxn(ctx, txn, rt, txnPath, txnResp) | |||
_, err := a.applyTxn(ctx, txn, rt, txnPath, txnResp) | |||
if err != nil && isWrite { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if err != nil && isWrite { | |
if err != nil { |
Please update this PR per #14149 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Marking as requiring sync with the 'main' variant of the PR.
Sorry about delay. Will update soon. |
ceda863
to
8ce41b2
Compare
Problem: We pass grpc context down to applier in readonly serializable txn. This context can be cancelled for example due to timeout. This will trigger panic inside applyTxn Solution: Only panic for transactions with write operations fixes etcd-io#14110 main PR etcd-io#14149 Signed-off-by: Bogdan Kanivets <bkanivets@apple.com>
8ce41b2
to
204d883
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a backport PR, so merging... Please add a changelog item if you haven't done it. @lavacat |
Problem: We pass grpc context down to applier in readonly serializable txn.
This context can be cancelled for example due to timeout.
This will trigger panic inside applyTxn
Solution: Only panic for transactions with write operations
fixes #14110
backported from main #14149
Signed-off-by: Bogdan Kanivets bkanivets@apple.com
Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.