Bug 1110117

Summary: [GSS] (6.4.0) Querying patching MBeans during shutdown results in IllegalStateException
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: James Livingston <jlivings>
Component: PatchingAssignee: Brian Stansberry <brian.stansberry>
Status: CLOSED CURRENTRELEASE QA Contact: Jan Martiska <jmartisk>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2.3CC: jason.greene, jawilson, jdoyle, joallen, joel.pearson, kconner, kkhan, msimka, myarboro, olubyans
Target Milestone: DR1   
Target Release: EAP 6.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
An attempt to query the patch status of a JBoss EAP instance could previously result in an `IllegalStateException` error being thrown. The root cause of this error was that the `InstallationManagerService` was not available as it had already been shut down. This issue has now been resolved by first checking if the `InstallationManagerService` is available and if so, the query proceeds.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1120535, 1120537    

Description James Livingston 2014-06-17 05:23:46 UTC
If the MBeans for the patching subsystem are queried during server shutdown, it can result in an IllegalStateException. InstallationManagerService has already had stop() called on it, so the value is null.

This can be reproduced by the attached EJB, which does a MBeanServer.queryMBeans(null, null); from the @PreDestroy method. It's in a loop to ensure it runs after the installation manager gets de-initialised.

java.lang.IllegalStateException
at org.jboss.as.patching.installation.InstallationManagerService.getValue(InstallationManagerService.java:87) [wildfly-patching-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.patching.installation.InstallationManagerService.getValue(InstallationManagerService.java:28) [wildfly-patching-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.msc.service.ServiceControllerImpl.getValue(ServiceControllerImpl.java:1158) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at org.jboss.as.patching.management.PatchResource$ElementProviderResourceProvider.children(PatchResource.java:139) [wildfly-patching-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.patching.management.PatchResource$ElementProviderResourceProvider.hasChildren(PatchResource.java:134) [wildfly-patching-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.controller.registry.AbstractModelResource.hasChildren(AbstractModelResource.java:81) [wildfly-controller-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.controller.registry.AbstractModelResource$DelegateResource.hasChildren(AbstractModelResource.java:279) [wildfly-controller-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.jmx.model.RootResourceIterator.doIterate(RootResourceIterator.java:57) [wildfly-jmx-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.jmx.model.RootResourceIterator.doIterate(RootResourceIterator.java:61) [wildfly-jmx-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.jmx.model.RootResourceIterator.iterate(RootResourceIterator.java:43) [wildfly-jmx-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.jmx.model.ModelControllerMBeanHelper.queryMBeans(ModelControllerMBeanHelper.java:125) [wildfly-jmx-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.jmx.model.ModelControllerMBeanServerPlugin.queryMBeans(ModelControllerMBeanServerPlugin.java:159) [wildfly-jmx-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.jmx.PluggableMBeanServerImpl.queryMBeans(PluggableMBeanServerImpl.java:816) [wildfly-jmx-8.1.0.Final.jar:8.1.0.Final]
at example.ShutdownMBeanQuery.destroy(ShutdownMBeanQuery.java:23)

Comment 4 Scott Mumford 2014-08-01 03:51:27 UTC
Is this only fixed in 6.4.0? Is it therefore a known issue in 6.3.0?

Pasting Bug Fix version of the release note here for future use:

"In previous releases of JBoss EAP 6, the patching subsystem `PatchResource`, while not having a dependency on the `InstallationManagerService`, may have attempted to use it when it may be shut down

This could cause an `IllegalStateException` to be thrown if a shutdown hook attempted to query the patching subsystem MBeans.

This release adds a check to confirm whether the `InstallationManagerService` is up prior to using it, thus avoiding the `IllegalStateException`."


Using Known Issue version of text for 6.3.0 Release Notes as issue not resolved at the time of writing.

Comment 6 Martin Simka 2014-09-18 12:50:25 UTC
verified on EAP 6.4.0.DR1.1

Comment 8 Dimitris Andreadis 2015-02-03 21:03:17 UTC
re-assign Emanuel's assigned bugs to Brian.