You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Bertrand Delacretaz <bd...@apache.org> on 2015/07/09 14:55:30 UTC
Sequential startup, experimenting with a new approach
Hi,
While working on SLING-4851 to extract the launchpad start levels
sequencing logic (aka "wait for the installer to do its thing at each
increasing start level") into independent bundles, I wrote a proof of
concept using the following API:
public interface StartLevelChangeBarrier {
CountDownLatch getStartLevelLatch(int startLevel);
}
Modules can supply such a service so that the new start levels
sequencer waits for their CountDownLatches to go to zero before
proceeding to the next start level.
The main advantage is that this avoids the current 2-seconds delay
between start levels that the launchpad currently needs, if we can
adapt the OSGi installer to provide this service efficiently. And if
the installer still needs this delay, it would at least be internal to
that module.
See the ticket for more details, feedback is welcome - I might not
work on this again for about two weeks but as usual feel free to steal
the good ideas if there are any ;-)
-Bertrand
Re: Sequential startup, experimenting with a new approach
Posted by Carsten Ziegeler <cz...@apache.org>.
Am 16.07.15 um 17:09 schrieb Robert Munteanu:
> On Thu, Jul 9, 2015 at 3:55 PM, Bertrand Delacretaz
> <bd...@apache.org> wrote:
>> public interface StartLevelChangeBarrier {
>> CountDownLatch getStartLevelLatch(int startLevel);
>> }
>>
>> Modules can supply such a service so that the new start levels
>> sequencer waits for their CountDownLatches to go to zero before
>> proceeding to the next start level.
>
>
> If all they should do is wait, I'd rather expose something else that a
> CountDownLatch. If they can count down, they will count down, which is
> probably not what we want. I can imagine the hacks :-)
>
> IMO the method could be
>
> void waitForStartLevel(int startLevel) throws InterruptedException;
>
I'm also wondering if we really need a new API? Right now we have the
StartupHandler which has the waitWithStartup(bool) method. Well, not the
best API but can't we simply use that?
Carsten
--
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org
Re: Sequential startup, experimenting with a new approach
Posted by Robert Munteanu <ro...@lmn.ro>.
On Thu, Jul 9, 2015 at 3:55 PM, Bertrand Delacretaz
<bd...@apache.org> wrote:
> public interface StartLevelChangeBarrier {
> CountDownLatch getStartLevelLatch(int startLevel);
> }
>
> Modules can supply such a service so that the new start levels
> sequencer waits for their CountDownLatches to go to zero before
> proceeding to the next start level.
If all they should do is wait, I'd rather expose something else that a
CountDownLatch. If they can count down, they will count down, which is
probably not what we want. I can imagine the hacks :-)
IMO the method could be
void waitForStartLevel(int startLevel) throws InterruptedException;
Robert
--
Sent from my (old) computer
Re: Sequential startup, experimenting with a new approach
Posted by Alexander Klimetschek <ak...@adobe.com>.
Not sure if I understand it fully, but I found JIRA's use of osgi "startup" pretty good. It seems very controlled, as it actively monitors plugins (osgi bundles of course) on startup and waits a given timeout until they start. If they fail to start, they get disabled. You see this all happening in the logging (e.g. when developing a JIRA plugin). It seems made so that non-core stuff can't bring the system down. I don't know much about the internals though, I assume they know what are "plugin" bundles and what are "core system" ones.
Cheers,
Alex
> On 09.07.2015, at 05:55, Bertrand Delacretaz <bd...@apache.org> wrote:
>
> Hi,
>
> While working on SLING-4851 to extract the launchpad start levels
> sequencing logic (aka "wait for the installer to do its thing at each
> increasing start level") into independent bundles, I wrote a proof of
> concept using the following API:
>
> public interface StartLevelChangeBarrier {
> CountDownLatch getStartLevelLatch(int startLevel);
> }
>
> Modules can supply such a service so that the new start levels
> sequencer waits for their CountDownLatches to go to zero before
> proceeding to the next start level.
>
> The main advantage is that this avoids the current 2-seconds delay
> between start levels that the launchpad currently needs, if we can
> adapt the OSGi installer to provide this service efficiently. And if
> the installer still needs this delay, it would at least be internal to
> that module.
>
> See the ticket for more details, feedback is welcome - I might not
> work on this again for about two weeks but as usual feel free to steal
> the good ideas if there are any ;-)
>
> -Bertrand