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

Dubbo 2.6.x cannot found correct method with telnet command #4565

Closed
2 tasks
qixiaobo opened this issue Jul 13, 2019 · 5 comments
Closed
2 tasks

Dubbo 2.6.x cannot found correct method with telnet command #4565

qixiaobo opened this issue Jul 13, 2019 · 5 comments
Milestone

Comments

@qixiaobo
Copy link
Contributor

qixiaobo commented Jul 13, 2019

  • 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.6.6
  • Operating System version: *nix
  • Java version: 1.7

When we use complex arguments, in telnet mode , we need use jsonArray to parse.
But in our code ,someone try to resolve an overwrite problem ,so make an issue #257
then @beiwei30 try to fix this issue use this code below 27917f2

The code will make the default method not take effect.

The code before like this

 private static Method findMethod(Exporter<?> exporter, String method, List<Object> args) {
        Invoker<?> invoker = exporter.getInvoker();
        Method[] methods = invoker.getInterface().getMethods();
        Method invokeMethod = null;
        for (Method m : methods) {
            if (m.getName().equals(method) && m.getParameterTypes().length == args.size()) {
                if (invokeMethod != null) { // 重载
                    if (isMatch(invokeMethod.getParameterTypes(), args)) {
                        invokeMethod = m;
                        break;
                    }
                } else {
                    invokeMethod = m;
                }
                invoker = exporter.getInvoker();
            }
        }
        return invokeMethod;

We can have a default method with the the methodName and the same length arguments.
But after the code change , it must provides the correct arguments type. We should know
json parse cannot give the corrent type. It maybe JsonObject or even HashMap.
So someone points out this problem #2766.
In my opinion ,we should not define the same name method. Such as retry or timeout , these configs may just take effect in method or service or provider .In these cases ,methodName can stands for method. That is to say ,a lot of configs just consider the method name .
In dubbo 2.7.x, for this issue ,dubbo provides a new telnet command called select.
So ,We should consider which is better.

@beiwei30 beiwei30 added this to the 2.6.8 milestone Jul 15, 2019
@cvictory
Copy link
Contributor

@qixiaobo Can you fire a pull request? I find it is very severe problem when there are override methods.

@qixiaobo
Copy link
Contributor Author

@qixiaobo Can you fire a pull request? I find it is very severe problem when there are override methods.
No override , but overwrite.

Yeah, I was told by @beiwei30 at morning . I will have a try .

@beiwei30
Copy link
Member

beiwei30 commented Aug 1, 2019

@qixiaobo sorry about it, I think I should have time to review it tomorrow.

@qixiaobo
Copy link
Contributor Author

qixiaobo commented Aug 3, 2019

@qixiaobo sorry about it, I think I should have time to review it tomorrow.

Never mind

@qixiaobo
Copy link
Contributor Author

Hope you may have time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants