[jboss-as7-dev] Help on service controller lifecycles

Jason T. Greene jason.greene at redhat.com
Thu Mar 22 11:17:02 EDT 2012


Hi Jeff,

Let's chat about this on IRC. The right way to do this is at a service 
level is with a listener, however the facility we mainly intend everyone 
to use in the context of a management operation is the 
ctx.removeService() call. So seems like we have an API pass through 
issue to figure out.

On 3/22/12 9:30 AM, Jeff Mesnil wrote:
> Hi guys,
>
> there are intermittent failures when updating a connection factory
> attributes in messaging subsystem[1] and I tracked it down to a problem
> of service states
>
> To make a story short, when we update a connection factory, we recreate
> its JNDI binding by doing a unbind() followed by a bind() on the
> AS7BindingRegistry[2].
> To bind a CF, we install a BindingService into the controller and set
> its mode to ACTIVE.
> To unbind a CF, we set its ServiceController's mode to REMOVE.
>
> However, it occurs that when doing a unbind() followed by a bind(),
> we may try to install a BindingService when it is not uninstalled yet
> (it's in the DOWN/REMOVING) state (removing the Thread.sleep() in [3] to
> highlight the issue)
>
> I fix the issue locally by checking in bind() whether the service
> controller exists and if it is DOWN/REMOVING wait until it is REMOVED.
> But I don't like sleeping until a service controller state changes. I am
> sure there is a more idiomatic/elegant way to do this.
> Does someone have pointers to show me the best way to do this?
>
>
> thanks,
> jeff
>
> [1] https://issues.jboss.org/browse/JBPAPP-8184
> [2]
> https://github.com/jmesnil/jboss-as/blob/JBPAPP-8184_connection_factory_failure/messaging/src/main/java/org/jboss/as/messaging/jms/AS7BindingRegistry.java
> [3]
> https://github.com/jmesnil/jboss-as/blob/JBPAPP-8184_connection_factory_failure/messaging/src/test/java/org/jboss/as/messaging/test/AS7BindingRegistryTestCase.java
>


-- 
Jason T. Greene
JBoss AS Lead / EAP Platform Architect
JBoss, a division of Red Hat


More information about the jboss-as7-dev mailing list