Uploaded image for project: 'JBoss Remoting (3+)'
  1. JBoss Remoting (3+)
  2. REM3-282

Update the main connection attempt notifier to resolve all pending connection attempts

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 5.0.0.Beta25
    • None
    • None

      Here's what seems to be triggering a hang in org.jboss.as.test.integration.ee.remotelookup.LookupTestCase:

      1) In ConnectionInfo.None#getConnection, a notifier is added to the future connection to transition to either a Shared state or a NotShared state once the connection has been established. After adding this notifier, we transition to the MaybeShared state.
      2) In MaybeShared#getConnection, the following notifier is added to the future connection to get the real future connection once the original connection is established:

      attempt.addNotifier((f2, futureResult1) -> {
          if (cancelFlag.get()) {
              futureResult1.setCancelled();
          } else {
              final IoFuture<Connection> realAttempt = ConnectionInfo.this.getConnection(endpoint, key, authenticationConfiguration, true);
              futureResult1.addCancelHandler(realAttempt);
              splice(futureResult1, realAttempt, authenticationConfiguration);
          }
      }, futureResult);
      

      If the notifier from 1) gets run before the notifier from 2), we transition to either the Shared or NotShared state prior to attempting to get the real future connection. LookupTestCase completes successfully in this case.

      If the notifier from 1) gets run after the notifier from 2), we attempt to get the real future connection while still in the MaybeShared state. LookupTestCase hangs in this case.

      It seems like we need to update MaybeShared#getConnection so that if we already have a pending attempt for the real future connection, we return RETRY. This will ensure that ConnectionInfo.this#getConnection will return the real future connection once we have transitioned to either the Shared or NotShared state.

      We need to update the main notifier to resolve all pending connection attempts.

              fjuma1@redhat.com Farah Juma
              fjuma1@redhat.com Farah Juma
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: