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

clientv3: document context to "Snapshot" API #9024

Merged
merged 2 commits into from
Dec 21, 2017
Merged

Conversation

gyuho
Copy link
Contributor

@gyuho gyuho commented Dec 15, 2017

Address #8993.

@gyuho gyuho changed the title clientv3: document context to Snapshot streaming API clientv3: document context to "Snapshot" API Dec 15, 2017
@@ -55,6 +55,11 @@ type Maintenance interface {
HashKV(ctx context.Context, endpoint string, rev int64) (*HashKVResponse, error)

// Snapshot provides a reader for a point-in-time snapshot of etcd.
// If the context "ctx" is canceled or timed out, reading from returned
// "io.ReadCloser" would error, and its error type is "grpc/*status.statusError".
Copy link
Member

Choose a reason for hiding this comment

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

should we add some sort test to ensure the error message and type is what we believed? I suspect if grpc decides to change underlying error and type, the error message and type could be different.

On the other hand, maybe just let the user knows that ctx cancel/timeout will error out io.ReadCloser is sufficient?

// If the context "ctx" is canceled or timed out, reading from returned
// "io.ReadCloser" would error out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah the error is always grpc/*status.statusError type, and we don't have tests around it. Now I think it's better to translate into context.Canceled or context.DeadlineExceeded as other APIs do. What do you think? /cc @xiang90

Copy link
Member

Choose a reason for hiding this comment

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

it seems like this added doc string is too detailed. we don't really have this for other apis. should we just keep the doc string a bit more general?

@xiang90
Copy link
Contributor

xiang90 commented Dec 16, 2017

lgtm.

@codecov-io
Copy link

codecov-io commented Dec 16, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@a7445d7). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #9024   +/-   ##
=========================================
  Coverage          ?   76.04%           
=========================================
  Files             ?      359           
  Lines             ?    29838           
  Branches          ?        0           
=========================================
  Hits              ?    22689           
  Misses            ?     5573           
  Partials          ?     1576
Impacted Files Coverage Δ
clientv3/maintenance.go 68.53% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a7445d7...e833b7c. Read the comment docs.

@xiang90
Copy link
Contributor

xiang90 commented Dec 21, 2017

@gyuho can we get this merged?

@gyuho gyuho merged commit 096c947 into etcd-io:master Dec 21, 2017
@gyuho gyuho deleted the snapshot-doc branch December 21, 2017 20:44
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.

4 participants