camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Why do we allow executing service shutdown logic twice (or more times)?
Date Tue, 12 Feb 2013 14:49:10 GMT
On Tue, Feb 12, 2013 at 2:38 PM, Raul Kripalani <> wrote:
> 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*.

Yeah shutdown should check the state as we do in stop etc.

But usually calling shutting down 2 times should really be idempotent,
but i guess the seda endpoint have the issue you found.

> 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]
> Cheers,
> *Raúl Kripalani*
> Apache Camel Committer
> Enterprise Architect, Program Manager, Open Source Integration specialist
> |
> | twitter: @raulvk <>

Claus Ibsen
Red Hat, Inc.
FuseSource is now part of Red Hat
Twitter: davsclaus
Author of Camel in Action:

View raw message