Project: springxd
Issue XD-1539: Eliminate stack trace on xd-container shutdown when active module running
After deploying stream (such as "time | log"), the xd-container emits the following stacktrace(s) if the stream is in a deployed state when that xd-container process is halted via CTRL-C: {code} 20:15:31,415 INFO main-EventThread module.ModuleDeployer:215 - removed SimpleModule [name=log, type=sink, group=s, index=1 @128936ff] 20:15:31,417 ERROR main-EventThread imps.CuratorFrameworkImpl:512 - Watcher exception java.lang.IllegalStateException: org.springframework.context.annotation.AnnotationConfigApplicationContext@7bf4bc83 has been closed already org.springframework.context.support.AbstractApplicationContext.assertBeanFactoryActive(AbstractApplicationContext.java:956) org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:978) org.springframework.xd.module.core.SimpleModule.getComponent(SimpleModule.java:214) org.springframework.xd.dirt.plugins.AbstractMessageBusBinderPlugin.unbindConsumerAndProducers(AbstractMessageBusBinderPlugin.java:140) org.springframework.xd.dirt.plugins.stream.StreamPlugin.beforeShutdown(StreamPlugin.java:74) org.springframework.xd.dirt.module.ModuleDeployer.beforeShutdown(ModuleDeployer.java:267) org.springframework.xd.dirt.module.ModuleDeployer.destroyModule(ModuleDeployer.java:217) org.springframework.xd.dirt.module.ModuleDeployer.handleUndeploy(ModuleDeployer.java:197) org.springframework.xd.dirt.module.ModuleDeployer.undeploy(ModuleDeployer.java:169) org.springframework.xd.dirt.server.ContainerRegistrar.undeployModule(ContainerRegistrar.java:252) org.springframework.xd.dirt.server.ContainerRegistrar$StreamModuleWatcher.process(ContainerRegistrar.java:580) org.apache.curator.framework.imps.NamespaceWatcher.process(NamespaceWatcher.java:56) org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:522) org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:498) 20:15:31,420 INFO main-EventThread server.ContainerRegistrar:250 - Undeploying module time-0: time type=source, deploymentProperties={count=1} 20:15:31,420 INFO main-EventThread module.ModuleDeployer:215 - removed SimpleModule [name=time, type=source, group=s, index=0 @51a42578] 20:15:31,420 ERROR main-EventThread imps.CuratorFrameworkImpl:512 - Watcher exception java.lang.IllegalStateException: org.springframework.context.annotation.AnnotationConfigApplicationContext@6d223732 has been closed already org.springframework.context.support.AbstractApplicationContext.assertBeanFactoryActive(AbstractApplicationContext.java:956) org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:978) org.springframework.xd.module.core.SimpleModule.getComponent(SimpleModule.java:214) org.springframework.xd.dirt.plugins.AbstractMessageBusBinderPlugin.unbindConsumerAndProducers(AbstractMessageBusBinderPlugin.java:144) org.springframework.xd.dirt.plugins.stream.StreamPlugin.beforeShutdown(StreamPlugin.java:74) org.springframework.xd.dirt.module.ModuleDeployer.beforeShutdown(ModuleDeployer.java:267) org.springframework.xd.dirt.module.ModuleDeployer.destroyModule(ModuleDeployer.java:217) org.springframework.xd.dirt.module.ModuleDeployer.handleUndeploy(ModuleDeployer.java:197) org.springframework.xd.dirt.module.ModuleDeployer.undeploy(ModuleDeployer.java:169) org.springframework.xd.dirt.server.ContainerRegistrar.undeployModule(ContainerRegistrar.java:252) org.springframework.xd.dirt.server.ContainerRegistrar$StreamModuleWatcher.process(ContainerRegistrar.java:580) org.apache.curator.framework.imps.NamespaceWatcher.process(NamespaceWatcher.java:56) org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:522) org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:498) {code}
Story points: 4