Skip to content

Fix bugs and improve default fallback logic of Apache Dubbo adapter - #1680

Merged
jasonjoo2010 merged 2 commits into
masterfrom
fix-dubbo-27x-adapter-20200819
Aug 20, 2020
Merged

Fix bugs and improve default fallback logic of Apache Dubbo adapter#1680
jasonjoo2010 merged 2 commits into
masterfrom
fix-dubbo-27x-adapter-20200819

Conversation

@sczyh30

@sczyh30 sczyh30 commented Aug 19, 2020

Copy link
Copy Markdown
Member

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

@jasonjoo2010 jasonjoo2010 left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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