[ 
https://issues.apache.org/jira/browse/FELIX-1812?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dennis Geurts reopened FELIX-1812:
----------------------------------


I'm reopening this is issue because I think one should be able to call 
System.exit / SystemBundle.stop anytime.

Furthermore: 
- As mentioned in a previous comment by karlp: "this is something one should 
never do": I wonder why, I haven't 
  found any clue in the spec that validates this remark. This btw also 
immediately disqualifies calling System.exit in the constructor of a service,
  if you are using the dependency manager, the init, start, stop, destroy 
callbacks. If you use a ServiceTracker, his callbacks are also 
  "out of bounds". It becomes less and less clear to me where one will be able 
to call System.exit such that it _immediately_ stops the java process

- If I replace the System.exit call with the more osgi-friendly call: 
SystemBundle.stop() the same deadlock occurs.
  the spec is more clear about this: It poses no restrictions as to where one 
is 'allowed' to call this method. Also the spec
  says the following: 
     1. The system bundle enters the STOPPING state.
     (great, I like that!)

     2. All ACTIVE bundles are stopped as described in the Bundle.stop method, 
except that their persistently recorded state indicates that they must be 
restarted 
     when the Framework is next started...
     (this is exactly the behavior I want: all bundles that have been started 
up to that moment must stop, and bundle that haven't been started yet do not 
get started)

- Doing this asynchronously does not prevent other bundles from being started. 
This is something I definitely do not want.





> deadlock on System.exit()
> -------------------------
>
>                 Key: FELIX-1812
>                 URL: https://issues.apache.org/jira/browse/FELIX-1812
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: felix-2.0.1
>            Reporter: Dennis Geurts
>            Assignee: Karl Pauls
>         Attachments: Activator.java, felix-framework-2.0.1.tar.gz, trace.log
>
>
> A deadlock occurs if System.exit() is called during startup of the Apache 
> Framework.
> additional information:
> We call System.exit() during the BundleActivator.start(BundleContext) method. 
> I will include a stacktrace and an example felix framework for reproduction.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to