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

fix: nicer error message for rpc errors #5325

Merged
merged 1 commit into from
Oct 28, 2022
Merged

Conversation

Jackmin801
Copy link
Contributor

@Jackmin801
Copy link
Contributor Author

Main issue is that all RpcErrors have .details() except for https://github.com/grpc/grpc/blob/master/src/python/grpcio/grpc/_channel.py#L361-L453

I have no idea when that one is triggered though. We can catch it in the line above the RpcError catch to explicitly deal with it but I wouldn't know what information would be useful in the error message.

@github-actions github-actions bot added size/XS area/core This issue/PR affects the core codebase component/client labels Oct 28, 2022
@codecov
Copy link

codecov bot commented Oct 28, 2022

Codecov Report

Merging #5325 (4f0b7aa) into master (0d02163) will increase coverage by 1.41%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #5325      +/-   ##
==========================================
+ Coverage   85.24%   86.65%   +1.41%     
==========================================
  Files          99       99              
  Lines        6451     6454       +3     
==========================================
+ Hits         5499     5593      +94     
+ Misses        952      861      -91     
Flag Coverage Δ
jina 86.65% <100.00%> (+1.41%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
jina/clients/base/grpc.py 85.91% <100.00%> (-2.32%) ⬇️
jina/orchestrate/deployments/config/k8s.py 100.00% <0.00%> (+0.61%) ⬆️
jina/enums.py 86.31% <0.00%> (+1.05%) ⬆️
...untimes/request_handlers/worker_request_handler.py 97.35% <0.00%> (+1.32%) ⬆️
jina/serve/runtimes/gateway/http/gateway.py 100.00% <0.00%> (+1.58%) ⬆️
jina/jaml/helper.py 83.94% <0.00%> (+2.18%) ⬆️
jina/clients/helper.py 100.00% <0.00%> (+2.38%) ⬆️
jina/orchestrate/deployments/config/helper.py 94.73% <0.00%> (+3.50%) ⬆️
...a/orchestrate/deployments/config/docker_compose.py 99.01% <0.00%> (+4.41%) ⬆️
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@Jackmin801
Copy link
Contributor Author

Jackmin801 commented Oct 28, 2022

Oh and the way I reproduce the error is to run a gateway on a different computer in my network then try to ping it with the CLI:

jina ping flow grpc://192.168.100.56:12345 --attempts 10

Local pings to local gateways aren't able to produce the "keepalive watchdog timeout" error because the error is thrown when a request is mid-flight then suddenly stops replying without closing the connection. If the pinger and gateway live in the same network namespace, this is not possible as the connection status will always be known by the pinger. And thus it can never timeout.

Copy link
Contributor

@samsja samsja left a comment

Choose a reason for hiding this comment

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

lgtm, sometime the best solution only requires a couple of line of code !

@Jackmin801 Jackmin801 marked this pull request as ready for review October 28, 2022 08:42
@samsja samsja merged commit 10e5cab into master Oct 28, 2022
@samsja samsja deleted the fix-5136-keepalive-error branch October 28, 2022 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core This issue/PR affects the core codebase component/client size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GRPC keep alive need a nice error message
3 participants