You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Aymen Furter <ay...@prodyna.com> on 2016/12/02 15:22:36 UTC

Bundle auto-restart

Hi all,

One small question:
Is there a way in karaf to automatically restart a bundle, if it is in
"Failure" state?

best regards
Aymen



Re: Bundle auto-restart

Posted by Guillaume Nodet <gn...@apache.org>.
In the console, you could do the following:

*karaf*@root()> feature:install scheduler

*karaf*@root()> schedule --period 1 { each $($.context bundles) { try { $it
start } } }

*karaf*@root()>


After that, every one second, the script will try to start all bundles.

2016-12-05 10:19 GMT+01:00 Aymen Furter <ay...@prodyna.com>:

> Hi,
>
> Thanks for your feedback & your advice.
>
> I will contact the mailing list (if required) if we run into issues
> solving the root cause of the problem ourself.
>
> best regards
> Aymen
>
> On 03.12.2016 15:39, James Carman wrote:
> I would say you might want to figure out the timing issues and perhaps do
> things differently. Are you using blueprint, declarative services, or just
> plain OSGi? What is the interdependency? Services?
>
> On Sat, Dec 3, 2016 at 7:32 AM Aymen Furter <<mailto:aymen.furter@prodyna.
> com>aymen.furter@prodyna.com<ma...@prodyna.com>> wrote:
> Yes, like a retry!
>
> I ran into issues having bundles that bring each other into Failure state
> during deployment.
> (If you restart all bundles afterwards it works fine)
>
> The solution is obviously to fix this inside the bundles (Usually OSGi
> related problems) you are developing.
>
> However, especially on a dev machine it would be nice if there would be an
> "auto restart if bundle goes into Failure state after x amount of time for
> n tries". If there is no such option (or if you would say there is no need
> for that option) that's a valuable and helpful answer for me aswell ;-)
>
> best regards
> Aymen
>
> Like a "retry"? What type of temporary failure are you looking to handle
> gracefully?
>
> On Fri, Dec 2, 2016 at 6:24 PM Aymen Furter <<mailto:<mailto:aymen.furter@
> prodyna.com>aymen.furter@prodyna.com<mailto:aymen.furter@prodyna.com
> >><ma...@prodyna.com>aymen.furter@prodyna.com<mailto:ayme
> n.furter@prodyna.com><ma...@prodyna.com>
> aymen.furter@prodyna.com<ma...@prodyna.com>>> wrote:
> Hi,
>
> Yes exactly!
>
> best regards
> Aymen
> > Hi,
> >
> > I guess you mean "automatically" ? Without any action from the user.
> >
> > Right ?
> >
> > Regards
> > JB
> >
> > On 12/02/2016 04:22 PM, Aymen Furter wrote:
> >> Hi all,
> >>
> >> One small question:
> >> Is there a way in karaf to automatically restart a bundle, if it is in
> >> "Failure" state?
> >>
> >> best regards
> >> Aymen
> >>
> >>
>
>
>
>
>


-- 
------------------------
Guillaume Nodet
------------------------
Red Hat, Open Source Integration

Email: gnodet@redhat.com
Web: http://fusesource.com
Blog: http://gnodet.blogspot.com/

Re: Bundle auto-restart

Posted by Aymen Furter <ay...@prodyna.com>.
Hi,

Thanks for your feedback & your advice.

I will contact the mailing list (if required) if we run into issues solving the root cause of the problem ourself.

best regards
Aymen

On 03.12.2016 15:39, James Carman wrote:
I would say you might want to figure out the timing issues and perhaps do things differently. Are you using blueprint, declarative services, or just plain OSGi? What is the interdependency? Services?

On Sat, Dec 3, 2016 at 7:32 AM Aymen Furter <<m...@prodyna.com>> wrote:
Yes, like a retry!

I ran into issues having bundles that bring each other into Failure state during deployment.
(If you restart all bundles afterwards it works fine)

The solution is obviously to fix this inside the bundles (Usually OSGi related problems) you are developing.

However, especially on a dev machine it would be nice if there would be an "auto restart if bundle goes into Failure state after x amount of time for n tries". If there is no such option (or if you would say there is no need for that option) that's a valuable and helpful answer for me aswell ;-)

best regards
Aymen

Like a "retry"? What type of temporary failure are you looking to handle gracefully?

On Fri, Dec 2, 2016 at 6:24 PM Aymen Furter <<m...@prodyna.com>>> wrote:
Hi,

Yes exactly!

best regards
Aymen
> Hi,
>
> I guess you mean "automatically" ? Without any action from the user.
>
> Right ?
>
> Regards
> JB
>
> On 12/02/2016 04:22 PM, Aymen Furter wrote:
>> Hi all,
>>
>> One small question:
>> Is there a way in karaf to automatically restart a bundle, if it is in
>> "Failure" state?
>>
>> best regards
>> Aymen
>>
>>





Re: Bundle auto-restart

Posted by James Carman <ja...@carmanconsulting.com>.
I would say you might want to figure out the timing issues and perhaps do
things differently. Are you using blueprint, declarative services, or just
plain OSGi? What is the interdependency? Services?

On Sat, Dec 3, 2016 at 7:32 AM Aymen Furter <ay...@prodyna.com>
wrote:

> Yes, like a retry!
>
> I ran into issues having bundles that bring each other into Failure state
> during deployment.
> (If you restart all bundles afterwards it works fine)
>
> The solution is obviously to fix this inside the bundles (Usually OSGi
> related problems) you are developing.
>
> However, especially on a dev machine it would be nice if there would be an
> "auto restart if bundle goes into Failure state after x amount of time for
> n tries". If there is no such option (or if you would say there is no need
> for that option) that's a valuable and helpful answer for me aswell ;-)
>
> best regards
> Aymen
>
> Like a "retry"? What type of temporary failure are you looking to handle
> gracefully?
>
> On Fri, Dec 2, 2016 at 6:24 PM Aymen Furter <<mailto:
> aymen.furter@prodyna.com>aymen.furter@prodyna.com<mailto:
> aymen.furter@prodyna.com>> wrote:
> Hi,
>
> Yes exactly!
>
> best regards
> Aymen
> > Hi,
> >
> > I guess you mean "automatically" ? Without any action from the user.
> >
> > Right ?
> >
> > Regards
> > JB
> >
> > On 12/02/2016 04:22 PM, Aymen Furter wrote:
> >> Hi all,
> >>
> >> One small question:
> >> Is there a way in karaf to automatically restart a bundle, if it is in
> >> "Failure" state?
> >>
> >> best regards
> >> Aymen
> >>
> >>
>
>
>
>

Re: Bundle auto-restart

Posted by Aymen Furter <ay...@prodyna.com>.
Yes, like a retry!

I ran into issues having bundles that bring each other into Failure state during deployment.
(If you restart all bundles afterwards it works fine)

The solution is obviously to fix this inside the bundles (Usually OSGi related problems) you are developing.

However, especially on a dev machine it would be nice if there would be an "auto restart if bundle goes into Failure state after x amount of time for n tries". If there is no such option (or if you would say there is no need for that option) that's a valuable and helpful answer for me aswell ;-)

best regards
Aymen

Like a "retry"? What type of temporary failure are you looking to handle gracefully?

On Fri, Dec 2, 2016 at 6:24 PM Aymen Furter <<m...@prodyna.com>> wrote:
Hi,

Yes exactly!

best regards
Aymen
> Hi,
>
> I guess you mean "automatically" ? Without any action from the user.
>
> Right ?
>
> Regards
> JB
>
> On 12/02/2016 04:22 PM, Aymen Furter wrote:
>> Hi all,
>>
>> One small question:
>> Is there a way in karaf to automatically restart a bundle, if it is in
>> "Failure" state?
>>
>> best regards
>> Aymen
>>
>>




Re: Bundle auto-restart

Posted by James Carman <ja...@carmanconsulting.com>.
Like a "retry"? What type of temporary failure are you looking to handle
gracefully?

On Fri, Dec 2, 2016 at 6:24 PM Aymen Furter <ay...@prodyna.com>
wrote:

> Hi,
>
> Yes exactly!
>
> best regards
> Aymen
> > Hi,
> >
> > I guess you mean "automatically" ? Without any action from the user.
> >
> > Right ?
> >
> > Regards
> > JB
> >
> > On 12/02/2016 04:22 PM, Aymen Furter wrote:
> >> Hi all,
> >>
> >> One small question:
> >> Is there a way in karaf to automatically restart a bundle, if it is in
> >> "Failure" state?
> >>
> >> best regards
> >> Aymen
> >>
> >>
>
>
> --
> Aymen Furter
> IT-Consultant / Software Engineer
>
> PRODYNA (Schweiz) AG
> Freie Strasse 2
> 4001 Basel
>
> T +41 44 532 35 90
> F +41 44 532 35 91
> M +41 79 618 44 30
>
> aymen.furter@prodyna.com
> www.prodyna.ch
>
>
> Sitz der Gesellschaft / Corporate Headquarters : PRODYNA (Schweiz) AG,
> Basel, Schweiz
> Registereintragung / Registration: Handelsregister Kanton Basel-Stadt
> CH-270.3.014.934-7
>
>

Re: Bundle auto-restart

Posted by Aymen Furter <ay...@prodyna.com>.
Hi,

Yes exactly!

best regards
Aymen
> Hi,
>
> I guess you mean "automatically" ? Without any action from the user.
>
> Right ?
>
> Regards
> JB
>
> On 12/02/2016 04:22 PM, Aymen Furter wrote:
>> Hi all,
>>
>> One small question:
>> Is there a way in karaf to automatically restart a bundle, if it is in
>> "Failure" state?
>>
>> best regards
>> Aymen
>>
>>


-- 
Aymen Furter
IT-Consultant / Software Engineer

PRODYNA (Schweiz) AG
Freie Strasse 2
4001 Basel
 
T +41 44 532 35 90
F +41 44 532 35 91
M +41 79 618 44 30
 
aymen.furter@prodyna.com
www.prodyna.ch
 
 
Sitz der Gesellschaft / Corporate Headquarters : PRODYNA (Schweiz) AG, Basel, Schweiz
Registereintragung / Registration: Handelsregister Kanton Basel-Stadt CH-270.3.014.934-7


Re: Bundle auto-restart

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

I guess you mean "automatically" ? Without any action from the user.

Right ?

Regards
JB

On 12/02/2016 04:22 PM, Aymen Furter wrote:
> Hi all,
>
> One small question:
> Is there a way in karaf to automatically restart a bundle, if it is in
> "Failure" state?
>
> best regards
> Aymen
>
>

-- 
Jean-Baptiste Onofr
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com