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 bugs and improve default fallback logic of Apache Dubbo adapter #1680

Merged
merged 2 commits into from
Aug 20, 2020

Conversation

sczyh30
Copy link
Member

@sczyh30 sczyh30 commented Aug 19, 2020

Describe what this PR does / why we need it

There are some problems in Apache Dubbo adapter (since 1.8.0-SNAPSHOT):

  • Unexpected behavior will occur when there are non-biz errors (e.g. Dubbo RPC timeout), which is caused by NPE in whenComplete hook in consumer filter.
  • The default fallback logic (wrap an error result with SentinelRpcException, which wraps a BlockException) may cause error when deserialization.

This PR fixes the bug and improves the default fallback of Apache Dubbo 2.7.x adapter.

Does this pull request fix one issue?

NONE

Describe how you did it

  • Add RuntimeException converting method (toRuntimeException) in BlockException and polish logic for BlockException validation
  • Fix NPE bug in consumer filter (when non-biz error occurred)
  • Improve default fallback in Dubbo 2.7.x adapter: convert the BlockException to a simple RuntimeException (with necessary message)
  • Polish code and comments

Describe how to verify it

Run the test cases.

Special notes for reviews

NONE

…ogic for validation

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
@sczyh30 sczyh30 added kind/bug Category issues or prs related to bug. kind/enhancement Category issues or prs related to enhancement. priority/urgent Most important, need to be worked on as soon as possible area/integrations Issues or PRs related to integrations with open-source components labels Aug 19, 2020
@sczyh30 sczyh30 added this to the 1.8.0 milestone Aug 19, 2020
@sczyh30 sczyh30 force-pushed the fix-dubbo-27x-adapter-20200819 branch from 20229fc to e0280b9 Compare August 20, 2020 01:48
- Fix NPE bug in consumer filter (when non-biz error occurred)
- Improve default fallback in Dubbo 2.7.x adapter: convert the BlockException to a simple RuntimeException (with necessary message)
- Polish code and comments

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
@sczyh30 sczyh30 force-pushed the fix-dubbo-27x-adapter-20200819 branch from e0280b9 to 02e23d1 Compare August 20, 2020 02:02
Copy link
Collaborator

@jasonjoo2010 jasonjoo2010 left a comment

Choose a reason for hiding this comment

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

LGTM

There are some unnecessary changes in pr and I suggest we can avoid it in future to keep pr small and simple.

@jasonjoo2010 jasonjoo2010 merged commit 5905874 into master Aug 20, 2020
@jasonjoo2010
Copy link
Collaborator

Thanks for your contribution!

@sczyh30 sczyh30 deleted the fix-dubbo-27x-adapter-20200819 branch August 20, 2020 02:23
CST11021 pushed a commit to CST11021/Sentinel that referenced this pull request Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/integrations Issues or PRs related to integrations with open-source components kind/bug Category issues or prs related to bug. kind/enhancement Category issues or prs related to enhancement. priority/urgent Most important, need to be worked on as soon as possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants