HiveMind
  1. HiveMind
  2. HIVEMIND-197

ShutdownCoordinator tries to construct unconstructed services.

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.1.1
    • Fix Version/s: None
    • Component/s: framework
    • Labels:
      None

      Description

      We are using Hivemind to construct test configurations. Some of the services are Shutdownlisteners but are not constructed during the test. When the registry is shutdown during the test, the shutdown coordinator tries to create those unconstructed services.

      18:52:11,656 ERROR [ShutdownCoordinatorImpl] Unable to shutdown <SingletonProxy
      for transparentpolitics.broadcastprovider.messageEndPointFactory($MessageEndPoin
      tFactory_110be2962ae)>: Unable to construct service transparentpolitics.broadcas
      tprovider.messageEndPointFactory: The HiveMind Registry has been shutdown.
      org.apache.hivemind.ApplicationRuntimeException: Unable to construct service tra
      nsparentpolitics.broadcastprovider.messageEndPointFactory: The HiveMind Registry
      has been shutdown.
      at org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constr
      uctNewServiceImplementation(AbstractServiceModelImpl.java:166)
      at org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constr
      uctServiceImplementation(AbstractServiceModelImpl.java:140)
      at org.apache.hivemind.impl.servicemodel.SingletonServiceModel.getActual
      ServiceImplementation(SingletonServiceModel.java:69)
      at $$MessageEndPointFactory_110be2962ae_110be2962b0._service($$MessageEn
      dPointFactory_110be2962ae_110be2962b0.java)
      at $$MessageEndPointFactory_110be2962ae_110be2962b0.registryDidShutdown(
      $$MessageEndPointFactory_110be2962ae_110be2962b0.java)
      at $$MessageEndPointFactory_110be2962ae_110be2962af.registryDidShutdown(
      $$MessageEndPointFactory_110be2962ae_110be2962af.java)
      at org.apache.hivemind.impl.ShutdownCoordinatorImpl.shutdown(ShutdownCoo
      rdinatorImpl.java:97)
      at org.apache.hivemind.impl.ShutdownCoordinatorImpl.shutdown(ShutdownCoo
      rdinatorImpl.java:80)
      at org.apache.hivemind.impl.RegistryInfrastructureImpl.shutdown(Registry
      InfrastructureImpl.java:379)
      at org.apache.hivemind.impl.RegistryImpl.shutdown(RegistryImpl.java:94)
      at com.transparentpolitics.AbstractUnitTest.cleanCurrentRegistry(Abstrac
      tUnitTest.java:245)

        Activity

        Hide
        James Carman added a comment -

        You register the actual service proxy as a shutdown listener? Can you give us a usecase for why this would be necessary? Typically, your implementation class implements RegistryShutdownListener so that it can free up any resources.

        Show
        James Carman added a comment - You register the actual service proxy as a shutdown listener? Can you give us a usecase for why this would be necessary? Typically, your implementation class implements RegistryShutdownListener so that it can free up any resources.
        Hide
        Patrick Moore added a comment -

        Don't know quite what you meant.

        But what I did was have a service that was never accessed during the test so because of hivemind's lazyloading the actual service was never created. But even though the actual service was never created, its registryDidShutdown() method was called. But of course this reguired creating the service, first, which is where things died.

        Show
        Patrick Moore added a comment - Don't know quite what you meant. But what I did was have a service that was never accessed during the test so because of hivemind's lazyloading the actual service was never created. But even though the actual service was never created, its registryDidShutdown() method was called. But of course this reguired creating the service, first, which is where things died.
        Hide
        James Carman added a comment -

        I'm pretty sure I understand what happened, but how about this. Can you paste some simple code that illustrates the issue (or maybe an attachment with a simple test case)? How did you register the service as a shutdown listener? I'd like to see that and your interface and impl class definitions. Also, paste in your hivemodule.xml stuff. This may just be a quick fix for you.

        Show
        James Carman added a comment - I'm pretty sure I understand what happened, but how about this. Can you paste some simple code that illustrates the issue (or maybe an attachment with a simple test case)? How did you register the service as a shutdown listener? I'd like to see that and your interface and impl class definitions. Also, paste in your hivemodule.xml stuff. This may just be a quick fix for you.

          People

          • Assignee:
            Unassigned
            Reporter:
            Patrick Moore
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development