Skip to content

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

Closed

Description

@yswwpp

在使用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服务没有启动。

Activity

  1. changed the title [-]使用Qos的一些问题[/-] [+]关于服务开启后Qos服务没启动问题排查[/+] on Jul 8, 2018
  2. chutian52 commented on Jul 9, 2018

    @chutian52

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

  3. web1992 commented on Jul 9, 2018

    @web1992
    Contributor

    It`s bug

  4. added this to the 2.6.3 milestone on Jul 9, 2018
  5. ralf0131 commented on Jul 15, 2018

    @ralf0131
    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.

  6. added
    help wanted
    on Jul 15, 2018
  7. modified the milestones: 2.6.3, 2.6.4 on Jul 23, 2018
  8. self-assigned this
    on Jul 27, 2018
  9. added a commit that references this issue on Aug 16, 2018
  10. carryxyh commented on Aug 29, 2018

    @carryxyh
    Member

    @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. :)

  11. diecui1202 commented on Sep 5, 2018

    @diecui1202

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

  12. ralf0131 commented on Sep 5, 2018

    @ralf0131
    Contributor

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

  13. added and removed
    help wanted
    on Sep 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions