Uploaded image for project: 'netvirt'
  1. netvirt
  2. NETVIRT-1111

BGP: some log messages have wrong LEVEL (ERROR instead of INFO)

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Medium
    • Resolution: Cannot Reproduce
    • None
    • None
    • None
    • None

    Description

      So I execute in ODL shell :

      karaf@root()> bgp-connect -p 7644 -h 127.0.0.1 add
      karaf@root()> 2018-02-21T11:04:42,103 | ERROR | org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.ConfigServer_AsyncDataTreeChangeListenerBase-DataTreeChangeHandler-0 | BgpRouter | 339 - org.opendaylight.netvirt.bgpmanager-impl - 0.6.0.SNAPSHOT | Trying to connect BGP config server at 127.0.0.1 : 7644
      2018-02-21T11:04:42,105 | ERROR | org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.ConfigServer_AsyncDataTreeChangeListenerBase-DataTreeChangeHandler-0 | BgpRouter | 339 - org.opendaylight.netvirt.bgpmanager-impl - 0.6.0.SNAPSHOT | Connected to BGP config server at 127.0.0.1 : 7644

      karaf@root()>

      Connection with quagga was established successfully and in the code snippet of BgpRouter  below we can see, that these messages were emitted, while Try branch was executed. And as opposite, in a catch section instead of ERROR level we can see messages which will be emitted at DEBUG level:

      
      public synchronized boolean connect(String bgpHost, int bgpPort) {
      String msgPiece = "BGP config server at " + bgpHost + ":" + bgpPort;
      
      if (!BgpConfigurationManager.isValidConfigBgpHostPort(bgpHost, bgpPort)) {
      LOG.error("Invalid config server host: {}, port: {}", bgpHost, bgpPort);
      return false;
      }
      
      final int numberOfConnectRetries = 180;
      configServerUpdated = false;
      RetryOnException connectRetry = new RetryOnException(numberOfConnectRetries);
      
      disconnect();
      setConnectTS(System.currentTimeMillis());
      do {
      if (!isBGPEntityOwner.getAsBoolean()) {
      LOG.error("Non Entity BGP owner trying to connect to thrift. Returning");
      isConnected = false;
      return false;
      }
      if (configServerUpdated) {
      LOG.error("Config server updated while connecting to server {} {}", bgpHost, bgpPort);
      isConnected = false;
      return false;
      }
      try {
      LOG.error("Trying to connect BGP config server at {} : {}", bgpHost, bgpPort);
      TSocket ts = new TSocket(bgpHost, bgpPort, CONNECTION_TIMEOUT);
      transport = ts;
      transport.open();
      ts.setTimeout(THRIFT_TIMEOUT_MILLI);
      isConnected = true;
      setLastConnectedTS(System.currentTimeMillis());
      LOG.error("Connected to BGP config server at {} : {}", bgpHost, bgpPort);
      break;
      } catch (TTransportException tte) {
      LOG.debug("Failed connecting to BGP config server at {} : {}. msg: {}; Exception :",
      bgpHost, bgpPort, msgPiece, tte);
      if (tte.getCause() instanceof ConnectException) {
      LOG.debug("Connect exception. Failed connecting to BGP config server at {} : {}. "
      + "msg: {}; Exception :", bgpHost, bgpPort, msgPiece, tte);
      connectRetry.errorOccured();
      } else {
      //In Case of other exceptions we try only 3 times
      connectRetry.errorOccured(60);
      }
      }
      } while (connectRetry.shouldRetry());

       

      There are a lot of places in bgpmanager, when log messages have such confusing LEVEL

      // 
      private void reConnect(TTransportException tte) {
      Bgp bgpConfig = bgpConfigSupplier.get();
      if (bgpConfig != null) {
      LOG.error("Received TTransportException, while configuring qthriftd, goind for Disconnect/Connect "
      + " Host: {}, Port: {}", bgpConfig.getConfigServer().getHost().getValue(),
      bgpConfig.getConfigServer().getPort().intValue());
      disconnect();
      try {
      

       

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            valentina.krasnobaeva Valentina Krasnobaeva
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: