Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-31873

Connection Listener and Event Listener can miss connectionEstablished event

XMLWordPrintable

      Adding a new Connection Listener or Event Listener to already connected Gerrit server will not receive connectionEstablished event.

      addListener in gerrit-events library (https://github.com/sonyxperiadev/gerrit-events.git) will not trigger connectionEstablished if connection is already established.

      See GerritServer.java:517

      This can be fixed here in this plugin but with risk of calling connectionEstablished twice

      gerritConnection.addListener(projectListUpdater);
      if (isConnected()) {
          projectListUpdater.connectionEstablished();
      }

      1) adding listener to not connected server
      2) server is connected -> calling connectionEstablished
      3) testing that server is connected -> calling connectionEstablished second time

      Maybe the best way is to change the code of addListener in gerrit-events library.

      Correct me if my thoughts are wrong. Comments are welcome.

      My knowledge of Java and Java internals are poor to fix it myself.

            rsandell rsandell
            engy Jiří Engelthaler
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: