-
Notifications
You must be signed in to change notification settings - Fork 87
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
Confusing behavior when trying to set deadlines on a gRPC call #1013
Comments
@alexander-fenster if you could please chime in here, that would be great. I filed #902 a while back, which is related. @AVaksman you had some ideas on how to fix some of these issues, so please chime in. @hengfengli, FYI. |
Adding some more debugging:
allows me to see the the It seems to be set inconsistently, and depending on the call, even when retries are not specified, the call is still retried... For example, using the CallOptions with what seems to be the most reliable way to set the deadline:
A Spanner commit will have the A Spanner ExecuteSql (database.run) will also have the Fully specifying the CallOptions.retry without specifying a timeout:
results in the default It seems the retry object in CallOptions is completely ignored for ExecuteStreamingSQL |
Assigning to @summer-ji-eng for this sprint as discussed. |
Folks, what is the status here? Is this issue still in effect or resolved? Thanks! |
This has been fixed #1100. Close for now. Feel free to open for any further question. |
So what is the proper usage of the call options param now to enable timeouts? |
I want to set a server-side deadline on a gRPC call so that the call is cancelled if it takes too long, This works in Java/GAX by setting the totalTimeout in RetrySettings, so the server-side appears to be working correctly.
Attempting to do the same in Node.js/GAX seems to be very confusing, and not matching the documentation:
TL/DR:
CallOptions.timeout
which is documented as a client-side timeout seems to also work as a server-side timeout, but only whenRetryOptions
are specified, which seems to go against the documentation.RetryOptions
give unexpected errors when specified together.RetryOptions
are ignored completely unless at least one RetryCode is given.totalTimeoutMillis
andmaxRetries
inBackoffSettings
BackoffSettings.totalTimeoutMillis
seems to be completely ignoredhttps://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L157
Demonstration of CallOptions.timeout on DEADLINE_EXCEEDED
Has no effect - the long-running gRPC is not timed out.
Has no effect - the long-running gRPC is not timed out.
Has no effect - the long-running gRPC is not timed out.
DEADLINE_EXCEEDED Raised
These tests indicate that the CallOptions.timeout is being passed as a deadline to the server (when it is documented as a client-side timeout), BUT only when a
CallOptions.retry.retryCodes
object is specified. The values in the CallOptions.retry object seem to be ignored.Demonstration of totalTimeoutMillis
Has no effect - the long-running gRPC is not timed out.
Has no effect - the long-running gRPC is not timed out.
totalTimeoutMillis
seems to be ignoredDemonstration of CallOptions.retry on DEADLINE_EXCEEDED
Has no effect - the long-running gRPC is not timed out.
Client-side error:
This makes no sense, as it seems perfectly possible to have retries and a total timeout (and the documentation implies this:
regardless of the retrying attempts made meanwhile.
DEADLINE_EXCEEDED Raised (woohoo!)
Has no effect - the long-running gRPC is not timed out.
This does correspond to the docs - that CallOptions.timeout is ignored for retryable calls.
Has no effect - the long-running gRPC is not timed out.
So at least 1 retryCode must be specified
Environment details
OS: Debian Rodete (20210511.01.04RD)
node: v12.21.0
npm: 7.5.2
google-gax@2.13.0
grpc/grpc-js@1.3.2
grpc-gcp@0.3.3
The text was updated successfully, but these errors were encountered: