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

Python Wrapper does not adhere to Timeout annotations #3613

Closed
mwm5945 opened this issue Sep 24, 2021 — with Board Genius Sync · 5 comments · Fixed by #3617
Closed

Python Wrapper does not adhere to Timeout annotations #3613

mwm5945 opened this issue Sep 24, 2021 — with Board Genius Sync · 5 comments · Fixed by #3617
Assignees

Comments

Copy link
Contributor

mwm5945 commented Sep 24, 2021

The timeout annotations specified here don't appear to have any effect on the python wrapper:

if ANNOTATION_GRPC_MAX_MSG_SIZE in annotations:

@mwm5945
Copy link
Contributor Author

mwm5945 commented Sep 24, 2021

It doesn't look like a timeout on the GRPC server is an option: https://github.com/grpc/grpc/blob/v1.38.x/include/grpc/impl/codegen/grpc_types.h

@axsaucedo
Copy link
Contributor

@mwm5945 from my understanding all unary calls from grpc are underneath still streaming calls, which means that the server would expect connections to remain open for the time that the client requests - this would then mean that the timeout would only be a configuration that would be set on the client side, which would be on the executor. Did you basically experience that you've set a timeout annotation and it wasn't being respected? If that is the case, then the issue would be in the executor, and we could have a look at why that is happening. Would you be able to confirm this point?

@mwm5945
Copy link
Contributor Author

mwm5945 commented Sep 24, 2021

We're currently running REST, and yes, saw that the timeout wasn't being respected. I was just curious to see if the grpc timeout was also propagated or not :)

@ukclivecox
Copy link
Contributor

ukclivecox commented Sep 25, 2021

The grpc timeout is added at present in the executor

if annotations != nil {
val := annotations[k8s.ANNOTATION_GRPC_TIMEOUT]
if val != "" {
timeout, err := strconv.Atoi(val)
if err != nil {
log.Error(err, "Failed to parse annotation to int so will ignore", k8s.ANNOTATION_GRPC_TIMEOUT, val)
} else {
dur := time.Millisecond * time.Duration(timeout)
log.Info("Adding grpc timeout to client", "value", timeout, "seconds", dur)
interceptors = append(interceptors, unaryClientInterceptorWithTimeout(dur))
}
}
}

But its true that would just timeout the connection in the executor but not sure how it would effect a long running call in the python client that was ongoing. So I imagine the timeout needs also to be added there to cause an exception.

@axsaucedo
Copy link
Contributor

@mwm5945 I have now added PR #3617 to ensure python also respects the timeouts - would be great if you can have a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants