-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[ruby] Make GRPC::DeadlineExceeded
report properly
#33565
Conversation
GRPC::DeadlineExceeded
report properlyGRPC::DeadlineExceeded
report properly
434ce0f
to
f5a9ee4
Compare
GRPC::DeadlineExceeded
report properlyGRPC::DeadlineExceeded
report properly
f5a9ee4
to
56cfa37
Compare
@apolcyn What do you think of this fix? |
ensure | ||
# Ensure we don't attempt to request the initial metadata again | ||
# in case an exception occurs. | ||
@metadata_received = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This becomes the opposite that of the original report that if run_batch
throws before sent RECV_INITIAL_METADATA, we are setting metadata_received anyways.
Ideally we need to c-core to propagate the error from completion queue so here we know whether to metadata_received or not.
Given that's a fairly large change in c-core, I incline to accept this to unblock the customer as I mentioned in the other comment in the issue, missing a RECV_INITIAL_METADATA doesn't really cause problems (for now at least).
@apolcyn Do you have any other concerns?
🙌🏾 Thanks to all who are working to resolve #33283. With increased traffic between our gRPC services, the frequency of this non-standard error being reported has also increased. This PR was approved by @alto-ruby approximately 2 months ago. However, it seems there has been no further activity since then. We look forward to this PR being merged. |
I'm seeing a conflict with #34016, which seems like it squelches the error? I'm not sure that's what we want; we want to see |
@alto-ruby is there anything that we can do about the concern raised here. I'd love to see this patch released. |
b6c1fde
to
136d9d6
Compare
@apolcyn Do you have any concerns to tis PR? |
@apolcyn |
@sampajano Hi Eryu, could you help me check the "import/copybara Pending" status? Thanks a lot! |
@HannahShiSFB Thanks for checking! I've approved the internal merge request and will find one more reviewer to approve too (2 is required)! |
@alto-ruby @HannahShiSFB There's some test failures. Can you work on resolving them? Thanks! :) |
136d9d6
to
e1464f0
Compare
The test failures look unrelated to this change. I rebased |
@stanhu Thanks for checking and rebasing! Running the tests again now! 😃 |
Test failures look unrelated again. 🤷 |
ok.. that's unfortunate.. can you maybe rebase again? 😅 |
In grpc v1.46.2 and later versions, grpc#29155 caused the Ruby client to return `GRPC::Core::CallError`, a non-standard error, with a message: `grpc_call_start_batch failed with outstanding read or write present (code=8)`. However, the actual error should have been `GRPC::DeadlineExceeded`. This occurred because when `GRPC::DeadlineExceeded` is raised, the `@metadata_received` flag doesn't get flipped. When `receive_and_check_status` runs to determine the error, the `RECV_INITIAL_METADATA` is erroneously sent again. To avoid this, flip the flag in an `ensure` block whenever the `RECV_INITIAL_METADATA` op is set. Closes grpc#33283
e1464f0
to
8508895
Compare
@sampajano Rebased again. Can you launch a CI run? |
Thank you! Done! Fingers crossed.. 😄 |
So close! Everything passed except for https://source.cloud.google.com/results/invocations/eeb9b8bd-12a5-4887-a504-47b85ac55c06/targets, but this seems like a flaky test. |
Looks like it! Lemme run it again! 😄 |
@sampajano Could we get this merged? |
@stanhu I'm sorry for the delays.. But it seems like there's another unrelated test failure.. 😅 I'm checking with the team how to get it merged in spite of the error.. But in the meantime, do you mind rebasing yet again and i'll run the test again..? Apologize again for the trouble.. |
@stanhu I manually re-imported the PR and it worked!! Thanks so much for your contribution here again! And sorry for the delays! 😃 |
@sampajano Thank you! |
@stanhu you're most welcome! Thank you again for your contribution! 😊 |
In grpc v1.46.2 and later versions, #29155 caused the Ruby client to return
GRPC::Core::CallError
, a non-standard error, with a message:grpc_call_start_batch failed with outstanding read or write present (code=8)
. However, the actual error should have beenGRPC::DeadlineExceeded
. This occurred because whenGRPC::DeadlineExceeded
is raised, the@metadata_received
flag doesn't get flipped. Whenreceive_and_check_status
runs to determinethe error, the
RECV_INITIAL_METADATA
is erroneously sent again.To avoid this, flip the flag in an
ensure
block whenever theRECV_INITIAL_METADATA
op is set.Closes #33283