[jboss-jira] [JBoss JIRA] (WFLY-2885) HttpListenerService start doesn't clean up if start fails
Tomaz Cerar (JIRA)
issues at jboss.org
Sun Feb 9 11:35:29 EST 2014
[ https://issues.jboss.org/browse/WFLY-2885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tomaz Cerar reassigned WFLY-2885:
---------------------------------
Assignee: Tomaz Cerar (was: Stuart Douglas)
> HttpListenerService start doesn't clean up if start fails
> ---------------------------------------------------------
>
> Key: WFLY-2885
> URL: https://issues.jboss.org/browse/WFLY-2885
> Project: WildFly
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Web (Undertow)
> Affects Versions: 8.0.0.CR1
> Reporter: Brian Stansberry
> Assignee: Tomaz Cerar
>
> HttpListenerService.prestart() does some registration stuff that doesn't get cleaned up if start() fails later on.
> I noticed this in the logs while debugging RolloutPlanTestCase failures on JDK8. Probably unrelated to those failures; just an FYI to give context.
> What happens in the test is it does an http-listener=xxx:add that is deliberately meant to fail in Stage.RUNTIME (due to a port conflict.) Later on the test does the same thing again. It's meant to fail there too, but I noticed in the logs that it failed for the *wrong reason*, before the port conflict:
> {code}
> [Server:main-one] 10:13:44,128 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.undertow.listener.maxFailOnePlan: org.jboss.msc.service.StartException in service jboss.undertow.listener.maxFailOnePlan: Failed to start service
> [Server:main-one] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
> [Server:main-one] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0]
> [Server:main-one] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0]
> [Server:main-one] at java.lang.Thread.run(Thread.java:744) [rt.jar:1.8.0]
> [Server:main-one] Caused by: java.lang.IllegalArgumentException: UT000053: Listener maxFailOnePlan already registered
> [Server:main-one] at io.undertow.server.ListenerRegistry.addListener(ListenerRegistry.java:32) [undertow-core-1.0.0.CR5.jar:1.0.0.CR5]
> [Server:main-one] at org.wildfly.extension.undertow.HttpListenerService.preStart(HttpListenerService.java:107)
> [Server:main-one] at org.wildfly.extension.undertow.ListenerService.start(ListenerService.java:121)
> [Server:main-one] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
> [Server:main-one] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
> [Server:main-one] ... 3 more
> {code}
> The error ^^^ will continue to happen until the server is restarted, even if the port conflict situation was fixed. It's because the ListenerRegistry.addListener call from the first attempt was never cleaned up.
> Cleaning up would have to be done in a catch block in ListenerService.start(). The code in stop() that normally does the cleanup does not get called if service start has failed.
> I expect we have this kind of problem in many places in the WF code.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list