camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raul Kripalani <r...@evosent.com>
Subject Why do we allow executing service shutdown logic twice (or more times)?
Date Tue, 12 Feb 2013 13:38:07 GMT
Hi,

I'm debugging why a pair of VM producer-consumer become disconnected in an
OSGi environment when the consumer bundle is restarted. See [1].

I can trace it back to the SedaEndpoint being shutdown twice: 1) when the
route is shutdown and 2) when the context is shutdown.

Why doesn't ServiceSupport#shutdown return immediately if the service has
already been shutdown? (we do this for start, stop, etc.). Strangely, we
only handle the case if the service *is shutting down*.

Anyway, due to duplicate execution of shutdown logic, the counter of Queue
References is decremented twice, "tricking" the component into thinking
that the producer has also disappeared and removing the queue altogether.

[1]
http://camel.465427.n5.nabble.com/VM-Queues-Disconnected-after-Karaf-Bundle-Update-tp5727205.html

Cheers,

*Raúl Kripalani*
Apache Camel Committer
Enterprise Architect, Program Manager, Open Source Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk <http://twitter.com/raulvk>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message