Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-8507

Calling gfsh connect while JMX manager is starting up can result in error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.14.0
    • None
    • management
    • None

    Description

      Running `gfsh -e connect` on a locator at the wrong time results in this error:

      Exception caused JMX Manager startup to fail because: 'Manager is already running'
      

      Looking at where this message is generated, I think this is coming from this code in JmxLocatorManager that tries to find a JMX manager and start one if it is not running

      //*** Manager may not be started at this point
       List<JmxManagerProfile> alreadyManaging =
              this.cache.getJmxManagerAdvisor().adviseAlreadyManaging();
          if (alreadyManaging.isEmpty()) {
            List<JmxManagerProfile> willingToManage =
                this.cache.getJmxManagerAdvisor().adviseWillingToManage();
            if (!willingToManage.isEmpty()) {
              synchronized (this) {
                alreadyManaging = this.cache.getJmxManagerAdvisor().adviseAlreadyManaging();
                if (alreadyManaging.isEmpty()) {
                  willingToManage = this.cache.getJmxManagerAdvisor().adviseWillingToManage();
                  if (!willingToManage.isEmpty()) {
                    JmxManagerProfile p = willingToManage.get(0);
                    if (p.getDistributedMember().equals(this.cache.getMyId())) {
                      if (logger.isDebugEnabled()) {
                        logger.debug("Locator starting jmx manager in its JVM");
                      }
                      try {
      //*** This call can throw an AlreadyRunningException if the manager is already running
      //*** failing this whole method.
                        ManagementService.getManagementService(this.cache).startManager();
                      } catch (CancelException ex) {
                        // ignore
                      } catch (VirtualMachineError err) {
                        SystemFailure.initiateFailure(err);
                        // If this ever returns, rethrow the error. We're poisoned
                        // now, so don't let this thread continue.
                        throw err;
                      } catch (Throwable t) {
                        SystemFailure.checkFailure();
                        return new JmxManagerLocatorResponse(null, 0, false, t);
                      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            upthewaterspout Dan Smith
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: