Uploaded image for project: 'Directory ApacheDS'
  1. Directory ApacheDS
  2. DIRSERVER-1151

Cannot have multiple instance in-process listening on different sockets / ports

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5.1
    • 1.5.3
    • ldap
    • None
    • Windows, JRE 1.5*

    Description

      http://issues.apache.org/jira/browse/DIRSERVER-485 is a closed issue regarding allowing multiple directory service instances to co-exist in a single process. It was solved by multiplexing directory service instances based on the configuration instance (as given by the Configuration.JNDI_KEY in the environment) which in turn returns the proper instance via .getInstanceId().

      However, there appears to be no way to create two instances based on ServerStartupConfiguration's and multiplex from the socket (port) on which each listens to down to the proper environment (and therefore to the proper directory service). Instead, whichever directory service is created last "wins", and all LDAP requests that come in over TCP/IP end up going to that instance, regardless of which port they arrive on.

      I was going to try to patch this myself, but I'm not sure where the proper state is that would be the right point to multiplex from socket -> environment. Right now, the environment is tied to a (singleton) SessionRegistry, which is wiped out (via SessionRegistry.releaseSingleton()) when a new LdapProtocolProvider is instantiated. If SessionRegistry were changed to map from ??? to different instances, there would still need to be multiplexing code for handling messages that passes them onto the proper SessionRegistry. Right now, messages seem to only be multiplexed based on type.

      Anyway, sorry this is a bit disjointed; I only started digging into the Apache DS code yesterday to figure out why my two instances on different ports were trampling on each other. I hope this is helpful and resolvable

      Attachments

        Activity

          People

            akarasulu Alex Karasulu
            phaedrus1313 Lee Feigenbaum
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: