-
Notifications
You must be signed in to change notification settings - Fork 4.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
transport: Add an Unwrap method to ConnectionError #5148
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 doesn't test the actual usage the user (you) are expecting. Is it possible to add a test in
/test
at thegrpc.Dial
level for this, to make sure we don't break it in the future?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.
@dfawley Sorry to see that this PR was closed. I didn't keep a close eye on it after it was approved. The test is for the actual problem. It probably affects several different use-cases.
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.
The test is performed in an internal package, and does not go through any public APIs. So the problem is, if we stop returning
transport.ConnectionError
and do something different instead, whatever externally-visible use case(s) you have will be broken, but none of our tests will fail. That makes this test much less useful than something ingrpc/test
. Let me know if you need any help figuring out how to add a test in that package, as it can be tricky.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.
@dfawley thanks for offering to help figuring out how to make a more encompassing test. Unfortunately, I'm in a situation where I don't have more time to spend. I created a workaround in our code when we got hit by the regression. Then, as a courtesy to you (since I really appreciate this package), I provided a PR with a fix, and a unit test to verify that the fix does what it's supposed to do. I also explained exactly how to reproduce the use-case to get the error from
DialContext
. I'm afraid that's as a far as I'm able to go with this, at least for the time being.Thanks again for an excellent package.
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.
AIUI you were relying on undocumented / unintentional behavior. This whole flow isn't something we recommend to users --
WithBlock
/WithReturnConnectionError
are not things we recommend using, and are not provided in most/any other languages' implementations of gRPC. As such, it is not a priority for us to maintain it. If we take this PR without an appropriate test, there's a reasonable chance it will break again in the future, and fixing it will be an extremely low priority for us, given the above. With a test, there's a much better chance we would notice it and prevent the breakage in the first place.If you're okay with this risk and the lack of real support of this feature, we can merge this as-is. If you would like to discuss other ways of doing what you're attempting that are better supported, then we are happy to help with that as well.
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.
Thanks for offering to help but we have good reasons for the approach chosen and no desire to change it at this point. I'd like you to merge this as-is.