Issue 1:
Weekly Report of Dubbo

This is a weekly report of Dubbo. It summarizes what have changed in the project during the passed week, including pr merged, new contributors, and more things in the future.

It is all done by @dubbo-bot which is a collaborate robot.

Repo Overview

Basic data

Baisc data shows how the watch, star, fork and contributors count changed in the passed week.

Watch
Star
Fork
Contributors

3217
27013 (↑191)
15166 (↑97)
201 (↑1)

Issues & PRs

Issues & PRs show the new/closed issues/pull requests count in the passed week.

New Issues
Closed Issues
New PR
Merged PR

20
16
25
24

PR Overview

Thanks to contributions from community, Dubbo team merged 24 pull requests in the repository last week. They are:

2.7.2 release (#4259)

Default future from jeff-lv (#4257)

performance tuning: cache service key (#4255)

performance tuning: channel connect status (#4254)

Performance tuning: keep heartbeat updated in io thread to avoid race condition. (#4246)

Applicationmodel revert (#4245)

getMethodparameter refactor (#4244)

delete useless code (#4242)

Perf reduce string allocation (#4240)

[Dubbo-4218] Fix NPE when the TagRouterRule addresses config is null (#4218) (#4236)

[Dubbo-4219] Remove DISCLAIMER (#4234)

[Dubbo-4219] Remove DISCLAIMER (#4233)

[Dubbo-4219] Remove DISCLAIMER (#4231)

fix #4227 : remove duplicate @OverRide (#4228)

[Dubbo-4183] Fix unstable tests in ConditionRouterTest (#4226)

performance tuning: completely remove 'default.' prefix check. (#4222)

performance tuning: avoid repeated address resolving. (#4220)

performance tuning: save rpcinvocation allocation (#4215)

optimize junit Assert usage (#4214)

[Test] add test for common-config (#4208)

[CI] Add jenkinsfile for dubbo snapshot deployment (#4205)

Java doc for remote netty4 (#4180)

reverse url of python (#4162)

Reduce context switching cost by optimizing thread model on consumer side. (#4131)

Code Review Statistics

Dubbo encourages everyone to participant in code review, in order to improve software quality. Every week @dubbo-bot would automatically help to count pull request reviews of single github user as the following. So, try to help review code in this project.

Contributor ID
Pull Request Reviews

@slievrly
7

@lovepoem
6

@ralf0131
4

@htynkn
3

@moriadry
2

@chickenlj
2

@web1992
2

@CrazyHZM
1

@Leishunyu
1

Contributors Overview

It is Dubbo team's great honor to have new contributors from community. We really appreciate your contributions. Feel free to tell us if you have any opinion and please share this open source project with more people if you could. If you hope to be a contributor as well, please start from https://github.com/apache/incubator-dubbo/blob/master/CONTRIBUTING.md .

Here is the list of new contributors:

@P3trur0

Thanks to you all.

Note: This robot is supported by Collabobot.

Issue 2:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.7.6

Operating System version: 10.14.6

Java version: 1.8

Steps to reproduce this issue

参数验证异常无法转换

java.lang.ClassCastException: javax.validation.ValidationException cannot be cast to javax.validation.ConstraintViolationException

想要获取参数的异常信息但是无法转换

Pls. provide [GitHub address] to reproduce this issue.

dubbo-filter/dubbo-filter-validation/src/main/java/org/apache/dubbo/validation/filter/ValidationFilter.java

Expected Result

public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
if (validation != null && !invocation.getMethodName().startsWith("$")
&& ConfigUtils.isNotEmpty(invoker.getUrl().getMethodParameter(invocation.getMethodName(), VALIDATION_KEY))) {
try {
Validator validator = validation.getValidator(invoker.getUrl());
if (validator != null) {
validator.validate(invocation.getMethodName(), invocation.getParameterTypes(), invocation.getArguments());
}
} catch (RpcException e) {
throw e;
}catch (ConstraintViolationException e) {
// only use exception's message to avoid potential serialization issue
return AsyncRpcResult.newDefaultAsyncResult(e, invocation);
} catch (Throwable t) {
return AsyncRpcResult.newDefaultAsyncResult(t, invocation);
}
}
return invoker.invoke(invocation);
}

or

public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
if (validation != null && !invocation.getMethodName().startsWith("$")
&& ConfigUtils.isNotEmpty(invoker.getUrl().getMethodParameter(invocation.getMethodName(), VALIDATION_KEY))) {
try {
Validator validator = validation.getValidator(invoker.getUrl());
if (validator != null) {
validator.validate(invocation.getMethodName(), invocation.getParameterTypes(), invocation.getArguments());
}
} catch (RpcException e) {
throw e;
} catch (ValidationException e) {
// only use exception's message to avoid potential serialization issue
return AsyncRpcResult.newDefaultAsyncResult(e, invocation);
} catch (Throwable t) {
return AsyncRpcResult.newDefaultAsyncResult(t, invocation);
}
}
return invoker.invoke(invocation);
}

What do you expected from the above steps？

Actual Result

public void ConstraintViolationExceptionTest() {
try{
.......
} catch (ConstraintViolationException e){
System.out.println(e.getConstraintViolations().iterator().next());
}
}

or

public void ConstraintViolationExceptionTest() {
try{
.......
} catch (ValidationException e){
ConstraintViolationException constraint = (ConstraintViolationException) e;
constraint.getConstraintViolations().iterator().next().getMessage();
}
}

What actually happens?

If there is an exception, please attach the exception trace:

Just put your stack trace here!