exceptions in PeriodicImageDownloadService will cause it to stop running

Bug #1361897 reported by Blake Rouse
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Julian Edwards

Bug Description

Exceptions from _start_download() -- or anywhere in this function -- will propagate up to the TimerService (well, the LoopingCall that it uses internally) and cause it to stop running; it considers any uncaught error as fatal. You ought to catch exceptions and log them instead of letting them get up to the service. I've used a wrapper function named with the prefix try_ in lp:~allenap/maas/safe-check-node-power to do this.

Related branches

Revision history for this message
Julian Edwards (julian-edwards) wrote :

What exceptions was it raising, out of interest?

Changed in maas:
assignee: nobody → Julian Edwards (julian-edwards)
status: Triaged → In Progress
Revision history for this message
Blake Rouse (blake-rouse) wrote :

It was not raising one specifically, but I have seen it raise one about the gpg key. I dont remember specifically what the name of the exception was.

I think Gavin was just talking in general, it doesn't matter what exception, it will fail. Here is the review that this bug is referencing.

https://code.launchpad.net/~blake-rouse/maas/rpc-import-images/+merge/232271

I think it would be nice to have a exception handling TimerService base class that just logs exceptions and keeps the timer service running.

Revision history for this message
Julian Edwards (julian-edwards) wrote : Re: [Bug 1361897] Re: exceptions in PeriodicImageDownloadService will cause it to stop running

On Wednesday 27 August 2014 00:31:20 you wrote:
> It was not raising one specifically, but I have seen it raise one about
> the gpg key. I dont remember specifically what the name of the exception
> was.
>
> I think Gavin was just talking in general, it doesn't matter what
> exception, it will fail. Here is the review that this bug is
> referencing.
>
> https://code.launchpad.net/~blake-rouse/maas/rpc-import-> images/+merge/232271
>
> I think it would be nice to have a exception handling TimerService base
> class that just logs exceptions and keeps the timer service running.

Yeah agreed, thanks.

What we need is a base class that:

1. handles connection retries
2. other boilerplate for timer-based services that use RPC
3. handles errors and logs them without taking out the service loop

Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
milestone: none → 1.7.0
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.