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

SocketCreatorFactory does not null out instance static

    XMLWordPrintableJSON

Details

    Description

      The SocketCreatorFactory has a static "instance" field that keeps the singleton factory. The factory has a reference in "distributionConfig" that ends up keeping the InternalDistributedSystem alive after disconnect.
      It also has a static close method but the product never calls it.
      To fix this leak do the following:
      On InternalDistributedSystem.disconnect add to the end of it:

                if (!attemptingToReconnect) {
                  SocketCreatorFactory.close();
                }
      

      Also I think it would be good to change SocketCreatorFactory.getInstance to null out the static when close it called like so:

        private static synchronized SocketCreatorFactory getInstance(boolean closing) {
          SocketCreatorFactory result = instance;
          if (result == null && !closing) {
            result = new SocketCreatorFactory();
            instance = result;
          } else if (result != null && closing) {
            instance = null;
          }
          return result;
        }
      

      Attachments

        Issue Links

          Activity

            People

              mivanac Mario Ivanac
              dschneider Darrel Schneider
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: