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

关于服务开启后Qos服务没启动问题排查 #2046

Closed
yswwpp opened this issue Jul 8, 2018 · 6 comments
Closed

关于服务开启后Qos服务没启动问题排查 #2046

yswwpp opened this issue Jul 8, 2018 · 6 comments
Assignees
Milestone

Comments

@yswwpp
Copy link

yswwpp commented Jul 8, 2018

在使用qos的时候发现22222端口始终没有被监听,调试才知道是启动qos服务的时候报错了,缺少netty相关的包,但是从日志中没有任何迹象。分析代码,类org.apache.dubbo.qos.protocol.QosProtocolWrapper中方法

private void startQosServer(URL url) {
       if (!hasStarted.compareAndSet(false, true)) {
           return;
       }

       try {
           boolean qosEnable = Boolean.parseBoolean(url.getParameter(QOS_ENABLE,"true"));
           if (!qosEnable) {
               return;
           }

           int port = Integer.parseInt(url.getParameter(QOS_PORT,"22222"));
           boolean acceptForeignIp = Boolean.parseBoolean(url.getParameter(ACCEPT_FOREIGN_IP,"true"));
           Server server = Server.getInstance();
           server.setPort(port);
           server.setAcceptForeignIp(acceptForeignIp);
           server.start();

       } catch (Throwable throwable) {
           //throw new RpcException("fail to start qos server", throwable);
       }
   }

其中 java Server server = Server.getInstance(); 报错之后,到catch中,结果日志也没有、异常也没上抛!!!
报错的那段代码虽然简单,但是有netty的依赖关系,所以还是存在报错的可能,建议此处catch之后打印一个警告级别的日志,用户可以清晰的看到为什么qos服务没有启动。

@yswwpp yswwpp changed the title 使用Qos的一些问题 关于服务开启后Qos服务没启动问题排查 Jul 8, 2018
@chutian52
Copy link

异常没有上抛应该是认为qos功能不影响dubbo使用吧?毕竟QOS只是个增强型的plugin

@web1992
Copy link
Contributor

web1992 commented Jul 9, 2018

It`s bug

@chickenlj chickenlj added this to the 2.6.3 milestone Jul 9, 2018
@ralf0131
Copy link
Contributor

Hi,

Could you please send a pull request to fix it?
I think it is a trivial change. I am going to a good first issue label.

@ralf0131 ralf0131 added help wanted Everything needs help from contributors good first issue labels Jul 15, 2018
@chickenlj chickenlj modified the milestones: 2.6.3, 2.6.4 Jul 23, 2018
@ralf0131 ralf0131 self-assigned this Jul 27, 2018
ralf0131 added a commit to ralf0131/dubbo that referenced this issue Jul 30, 2018
@ralf0131 ralf0131 mentioned this issue Jul 30, 2018
5 tasks
diecui1202 pushed a commit that referenced this issue Aug 16, 2018
* Not to accept foreign ip by default.

* Log if fail to start qos server. #2046

* Fix typo. No functional change.

* Remove redundant declaration.

* Sync dubbo.xsd to compact dubbo.xsd.

* Simplify code and add comments.

* Add log message if qos is not enabled.

* Fix UT failure.
@carryxyh
Copy link
Member

carryxyh commented Aug 29, 2018

@yswwpp

This problem has been fixed by this pr:
#2153

Is there any other questions for this issue? If not, we will close it soon. :)

@diecui1202
Copy link

@ralf0131 Does #2153 need to merge back to 2.6.x?

@ralf0131
Copy link
Contributor

ralf0131 commented Sep 5, 2018

I think so. @diecui1202 I can do the back port

@diecui1202 diecui1202 added status/fix-in-next-release and removed good first issue help wanted Everything needs help from contributors labels Sep 5, 2018
@diecui1202 diecui1202 mentioned this issue Sep 6, 2018
6 tasks
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

7 participants