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

When blocked in Dubbo adapter, Sentinel should wrap SentinelRpcException with Result rather than directly throw it out #1252

Closed
lesline opened this issue Jan 14, 2020 · 6 comments
Labels
area/integrations Issues or PRs related to integrations with open-source components good first issue Good for newcomers kind/enhancement Category issues or prs related to enhancement.

Comments

@lesline
Copy link

lesline commented Jan 14, 2020

when block exception happen, sentinel return RpcException exception,not SentinelRpcException exception

Type: bug report

Describe problem:

problem code

com.alibaba.csp.sentinel.adapter.dubbo.fallback.DefaultDubboFallback
public class DefaultDubboFallback implements DubboFallback {
    @Override
    public Result handle(Invoker<?> invoker, Invocation invocation, BlockException ex) {
        // Just wrap and throw the exception.
        throw new SentinelRpcException(ex);
    }
}

should change to :

public class DefaultDubboFallback implements DubboFallback {

    @Override
    public Result handle(Invoker<?> invoker, Invocation invocation, BlockException ex) {
        // Just wrap and throw the exception.
        RpcResult result = new RpcResult();
        result.setException(new SentinelRpcException(ex));
        return result;
    }
}

Tell us your environment

<version>1.7.2-SNAPSHOT</version>
@sczyh30
Copy link
Member

sczyh30 commented Jan 14, 2020

Good idea. Would you like to contribute a PR to improve it?

@sczyh30 sczyh30 added the area/integrations Issues or PRs related to integrations with open-source components label Jan 15, 2020
@lesline
Copy link
Author

lesline commented Apr 13, 2020

ok

@sczyh30 sczyh30 added the good first issue Good for newcomers label Jun 15, 2020
@sczyh30 sczyh30 added the kind/enhancement Category issues or prs related to enhancement. label Jun 29, 2020
@sczyh30
Copy link
Member

sczyh30 commented Jun 29, 2020

PRs are welcomed for Apache Dubbo 2.7.x adapter!

@sczyh30 sczyh30 changed the title when block exception happen, sentinel return RpcException exception,not SentinelRpcException exception When blocked in Dubbo adapter, Sentinel should wrap SentinelRpcException with Result rather than directly throw it out Jun 29, 2020
@cdfive
Copy link
Collaborator

cdfive commented Jul 22, 2020

Maybe relate to #374, #1065, #1017, when using DefaultDubboFallback, we need to be careful about Dubbo ExceptionFilter, Serialize/Deserialize and JDK vension.

@wzg923
Copy link
Contributor

wzg923 commented Sep 23, 2020

#1065

@sczyh30
Copy link
Member

sczyh30 commented Mar 9, 2021

Already resolved in 1.8.x.

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 good first issue Good for newcomers kind/enhancement Category issues or prs related to enhancement.
Projects
None yet
Development

No branches or pull requests

4 participants