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

etcdserver: better v3 api error handling #3534

Merged
merged 1 commit into from
Sep 16, 2015
Merged

Conversation

xiang90
Copy link
Contributor

@xiang90 xiang90 commented Sep 15, 2015

Start to handle error

return &pb.ResponseUnion{ResponseRange: applyRange(kv, union.RequestRange)}
resp, err := applyRange(kv, union.RequestRange)
if err != nil {
panic("unexpected error during txn")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does it panic here? It may be ErrCompacted, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should check potential errors before executing the transaction. we cannot abort executed commands.

see line 120 for more details.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. So the point is that as long as txn starts, it should be successful.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It MUST be.

@yichengq
Copy link
Contributor

LGTM

xiang90 added a commit that referenced this pull request Sep 16, 2015
etcdserver: better v3 api error handling
@xiang90 xiang90 merged commit ec41425 into etcd-io:master Sep 16, 2015
@xiang90 xiang90 deleted the grpc_err branch September 16, 2015 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants