Details
-
Type:
Improvement Request
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 5.1
-
Fix Version/s: 5.6.0
-
Component/s: None
-
Security Level: Public
-
- Environment:
- *
Activity
| Field | Original Value | New Value |
|---|---|---|
| Description |
In the AbstractComponent, lifecycle operations contain atomic calls to which all throws Exceptions. These exceptions are not handled atomically but globally with a single catch block. If one atomic operation fails, the next ones will never be called and the component can be in a inconcistent state or some resources will potentially never be released. For example look at the stop method : public final void stop() throws JBIException { this.logger.info("Stop component..."); try { this.logger.fine("Calling specific stop..."); this.doStop(); this.logger.fine("Specific stop done."); } finally { this.notificationService.stop(); this.deactivateServiceEndpointList(); this.unregisterRuntimeConfigurationMBean(); this.unregisterInterceptorManagerMBean(); // stop first the acceptor Manager as it aggregates the worker // manager this.acceptorManager.stop(); this.processorManager.stop(); this.asyncManager.stop(); } this.logger.info("Component stopped"); } What happens if "this.notificationService.stop();" throws an exception? |
In the AbstractComponent, lifecycle operations contain atomic calls to which all throws Exceptions. These exceptions are not handled atomically but globally with a single catch block. If one atomic operation fails, the next ones will never be called and the component can be in a inconcistent state or some resources will potentially never be released.
For example look at the stop method : {code:java} public final void stop() throws JBIException { this.logger.info("Stop component..."); try { this.logger.fine("Calling specific stop..."); this.doStop(); this.logger.fine("Specific stop done."); } finally { this.notificationService.stop(); this.deactivateServiceEndpointList(); this.unregisterRuntimeConfigurationMBean(); this.unregisterInterceptorManagerMBean(); // stop first the acceptor Manager as it aggregates the worker // manager this.acceptorManager.stop(); this.processorManager.stop(); this.asyncManager.stop(); } this.logger.info("Component stopped"); } {code} What happens if "this.notificationService.stop();" throws an exception? |
| Priority | Blocker [ 1 ] |
| Status | New [ 10000 ] | Open [ 10002 ] |
| Priority | Blocker [ 1 ] | Major [ 3 ] |
| Assignee | Mathieu Carrolle [ mcarrolle ] | Victor NOËL [ vnoel ] |
| Status | Open [ 10002 ] | In Progress [ 10003 ] |
| Status | In Progress [ 10003 ] | Resolved [ 10004 ] |
| Fix Version/s | 5.6.0 [ 10611 ] | |
| Resolution | Fixed [ 1 ] |