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

Implement RFC 032 gRPC Client Deadlines #194

Merged
merged 1 commit into from Feb 18, 2022

Conversation

thefringeninja
Copy link
Contributor

@thefringeninja thefringeninja commented Feb 4, 2022

Changed: Default deadlines for reading operations set to Inifinity
Changed: Deadlines for all other operations defaults to 10s
Changed: Removed Timeout from EventStoreOperationOptions and moved it to an explicit deadline parameter on all operations except for subscriptions. Consequently, configureOperationOptions callback has been removed for most operations.

This PR configures default deadlines for each operation according to the following table:

Operation Default Timeout Overridden by defaultDeadline Overridden by deadline
Stream and $all Reads infinity N Y
Stream and $all Subscriptions (Including Persistent Subscriptions) infinity N N
Writes 10 seconds Y Y
Management operations 10 seconds Y Y
Batch Append 10 seconds Y Y

This aligns with the other clients.

Fixes #184

@thefringeninja thefringeninja self-assigned this Feb 4, 2022
@thefringeninja thefringeninja changed the title Implement RFC 032 Implement RFC 032 gRPC Client Deadlines Feb 4, 2022
@thefringeninja thefringeninja marked this pull request as ready for review February 4, 2022 12:08
@thefringeninja thefringeninja linked an issue Feb 4, 2022 that may be closed by this pull request
6 tasks
@@ -255,7 +258,13 @@ await foreach (var response in call.ResponseStream.ReadAllAsync(_cancellationTok

try {
writeResult.TrySetResult(response.ToWriteResult());
} catch (Exception ex) when (ex is not RpcException) {
} catch (RpcException ex) when (ex.StatusCode is not StatusCode.NotFound or
Copy link
Contributor

Choose a reason for hiding this comment

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

QUESTION: Why was this additional condition added for RpcException here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

'Normal' errors on batch append will be sent inside the proto itself and will not be handled by grpc.net. These status codes represent grpc errors that you might see (for example NotFound if the endpoint is not there or Unavailable if it's not started yet) and then you will need to close the channel.

Copy link
Contributor

Choose a reason for hiding this comment

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

i think a comment would be in order to explain why its these specific statuses

... although DeadLineExceeded should probably be in this list shouldn't it, otherwise a timeout would cause the batchappender to terminate

... in fact, isn't DeadlineExceeded the only possible RpcException we could get here?

Copy link
Contributor

@timothycoleman timothycoleman left a comment

Choose a reason for hiding this comment

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

looks good, minor comments in line, want to lookg at append timeouts a bit more too

@timothycoleman
Copy link
Contributor

timothycoleman commented Feb 15, 2022

i pushed a branch rfc-032-tim with a couple of changes & resolving the merge conflicts, feel free to squash those into this pr if you like

then there is just the just the configureOptions convo left and the RpcException handling in batchappender

@oskardudycz
Copy link
Contributor

oskardudycz commented Feb 16, 2022

@timothycoleman, @thefringeninja, for the future, it'd be good to not squash changes into a single commit on such a big PR before getting final reviews, as it's hard to see what has changed or not and don't have to go through the whole PR doing the review again.

hayley-jean
hayley-jean previously approved these changes Feb 17, 2022
Copy link
Contributor

@timothycoleman timothycoleman left a comment

Choose a reason for hiding this comment

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

looks good 👍

@timothycoleman timothycoleman merged commit 786a246 into EventStore:master Feb 18, 2022
@thefringeninja thefringeninja deleted the rfc-032 branch February 18, 2022 14:43
thefringeninja pushed a commit to thefringeninja/EventStore-Client-Dotnet that referenced this pull request Feb 22, 2022
Implement RFC 032 gRPC Client Deadlines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Standardize .Net gRPC client deadlines
4 participants