-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Camel] "BundleContext is no longer valid" error after restarting/reinstalling Camel+Kura quickstart bundle #125
Comments
Hi @cdealti I install our quickstart:
Then I uninstall it:
Now Camel waits for 5 minutes to give inflight messages chance to be processed. After 5 minutes quickstart bundle is stopped and uninstalled. So far so good :) . Now I install the same bundle again:
But then I see the exception from the issue description. It looks more like a Equinox issue, then Camel issue for me. Camel seems just to be reporting the fact that bundle I'm starting has invalid context. But I think that Equinox/Kura causes the bundle to be invalid. What do you think? |
Can it be somehow related to SRC lifecycle? Any thoughts? |
I don't think the problem is with the bundle you are starting, but rather On Wed, Apr 27, 2016 at 9:47 AM, Henryk Konsek notifications@github.com
|
I would check in the log whether the previous CamelRouter component On Wed, Apr 27, 2016 at 11:31 AM, Benjamin Cabé kartben@gmail.com wrote:
|
@hekonsek as @kartben suggested I'd take a look to the unistall of the previous bundle.
|
@hekonsek I've also tried various uninstall/install of the other camel bundles without success. Is there any cleanup needed by the quickstart component on |
@hekonsek Any progress on this? |
You mean bundles like camel-core? Or camel-core-osgi? There is not cleanup needed, so that would be strange. I will work on this again after PTO. |
This seems like a deadlock situation to me which is in the end "resolved" by running into a timeout. Maybe not properly cleaning up by that. The The other thread is the service itself, calling into the I think it should be sufficient to not use an executor service from Camel, but to simply maintain a plain |
This change fixes one part of the BundleContext issue. While shutting down an Apache Camel router the shutdown runs into a deadlock, which will be resolved by Camel after a timeout by simply killing the thread. Shutting down the camel context and its services is being forked into another thread, while holding a mutex lock on the camel context. At the same time the other thread shuts down all camel components registered with the context and will also shut down the camel based "cloud client". Which will then shut down its routes, and with that make a call to the camel context from this "shutdown thread", requiring a mutex lock on the same context object. While the first thread it still waiting for the second thread to finish. It seems as there is no proper way to handle this issue. But is it possible so try and detect if a shutdown is currently in progress. In this case the camel cloud client shutdown now does not destroy its routes, since they are stopped anyway by the whole shutdown process. This prevents the shutdown thread trying to acquire the same sync lock. Signed-off-by: Jens Reimann <jreimann@redhat.com>
This is part 2 of the bundle context issue. This change fixes an issue with the client cache, which may leak cloud client connections. Signed-off-by: Jens Reimann <jreimann@redhat.com>
Signed-off-by: Jens Reimann <jreimann@redhat.com>
Fixed by Jens pull request. |
The text was updated successfully, but these errors were encountered: