* [PATCH 2/2] buildslave-janitor: Add in try/except handling to make calls robust against failure
@ 2014-03-19 14:03 Richard Purdie
2014-03-19 14:28 ` Burton, Ross
0 siblings, 1 reply; 3+ messages in thread
From: Richard Purdie @ 2014-03-19 14:03 UTC (permalink / raw)
To: yocto, Burton Ross, Flanagan, Elizabeth
There is a suspicion that the command can fail causing the janitor trash
removal process to exit. This adds in some exception handling to deal
with this. It include a timeout to stop it entering nasty loops.
This combined with the previous patch should let us figure out what
error conditions its hitting.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
bin/buildslave-janitor | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/bin/buildslave-janitor b/bin/buildslave-janitor
index 153f18d..2cfef86 100755
--- a/bin/buildslave-janitor
+++ b/bin/buildslave-janitor
@@ -66,11 +66,16 @@ def trash_processor(trashdir):
print("Not prepared to use a trashdir of /")
return
while True:
- files = os.listdir(trashdir)
- if files:
- os.system("ionice -c 3 rm %s -rf" % trashdir)
- else:
- time.sleep(30*60) # 30 minutes
+ try:
+ files = os.listdir(trashdir)
+ if files:
+ os.system("ionice -c 3 rm %s -rf" % trashdir)
+ else:
+ time.sleep(30*60) # 30 minutes
+ except Exception as e:
+ print("Exception %s in trash cleaner" % str(e))
+ time.sleep(60) # 1 minute timeout to prevent crazy looping
+ pass
return
def mirror_processor(mirrordir):
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH 2/2] buildslave-janitor: Add in try/except handling to make calls robust against failure
2014-03-19 14:03 [PATCH 2/2] buildslave-janitor: Add in try/except handling to make calls robust against failure Richard Purdie
@ 2014-03-19 14:28 ` Burton, Ross
2014-03-19 15:38 ` Flanagan, Elizabeth
0 siblings, 1 reply; 3+ messages in thread
From: Burton, Ross @ 2014-03-19 14:28 UTC (permalink / raw)
To: Richard Purdie; +Cc: yocto
Both patches look good, Reviewed-by: Ross Burton <ross.burton@intel.com>
Ross
On 19 March 2014 14:03, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> There is a suspicion that the command can fail causing the janitor trash
> removal process to exit. This adds in some exception handling to deal
> with this. It include a timeout to stop it entering nasty loops.
>
> This combined with the previous patch should let us figure out what
> error conditions its hitting.
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
> bin/buildslave-janitor | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/bin/buildslave-janitor b/bin/buildslave-janitor
> index 153f18d..2cfef86 100755
> --- a/bin/buildslave-janitor
> +++ b/bin/buildslave-janitor
> @@ -66,11 +66,16 @@ def trash_processor(trashdir):
> print("Not prepared to use a trashdir of /")
> return
> while True:
> - files = os.listdir(trashdir)
> - if files:
> - os.system("ionice -c 3 rm %s -rf" % trashdir)
> - else:
> - time.sleep(30*60) # 30 minutes
> + try:
> + files = os.listdir(trashdir)
> + if files:
> + os.system("ionice -c 3 rm %s -rf" % trashdir)
> + else:
> + time.sleep(30*60) # 30 minutes
> + except Exception as e:
> + print("Exception %s in trash cleaner" % str(e))
> + time.sleep(60) # 1 minute timeout to prevent crazy looping
> + pass
> return
>
> def mirror_processor(mirrordir):
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH 2/2] buildslave-janitor: Add in try/except handling to make calls robust against failure
2014-03-19 14:28 ` Burton, Ross
@ 2014-03-19 15:38 ` Flanagan, Elizabeth
0 siblings, 0 replies; 3+ messages in thread
From: Flanagan, Elizabeth @ 2014-03-19 15:38 UTC (permalink / raw)
To: Burton, Ross; +Cc: yocto
Agreed. Pulling them. Thanks.
-b
On Wed, Mar 19, 2014 at 7:28 AM, Burton, Ross <ross.burton@intel.com> wrote:
> Both patches look good, Reviewed-by: Ross Burton <ross.burton@intel.com>
>
> Ross
>
> On 19 March 2014 14:03, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
>> There is a suspicion that the command can fail causing the janitor trash
>> removal process to exit. This adds in some exception handling to deal
>> with this. It include a timeout to stop it entering nasty loops.
>>
>> This combined with the previous patch should let us figure out what
>> error conditions its hitting.
>>
>> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
>> ---
>> bin/buildslave-janitor | 15 ++++++++++-----
>> 1 file changed, 10 insertions(+), 5 deletions(-)
>>
>> diff --git a/bin/buildslave-janitor b/bin/buildslave-janitor
>> index 153f18d..2cfef86 100755
>> --- a/bin/buildslave-janitor
>> +++ b/bin/buildslave-janitor
>> @@ -66,11 +66,16 @@ def trash_processor(trashdir):
>> print("Not prepared to use a trashdir of /")
>> return
>> while True:
>> - files = os.listdir(trashdir)
>> - if files:
>> - os.system("ionice -c 3 rm %s -rf" % trashdir)
>> - else:
>> - time.sleep(30*60) # 30 minutes
>> + try:
>> + files = os.listdir(trashdir)
>> + if files:
>> + os.system("ionice -c 3 rm %s -rf" % trashdir)
>> + else:
>> + time.sleep(30*60) # 30 minutes
>> + except Exception as e:
>> + print("Exception %s in trash cleaner" % str(e))
>> + time.sleep(60) # 1 minute timeout to prevent crazy looping
>> + pass
>> return
>>
>> def mirror_processor(mirrordir):
>>
>>
>>
> ---------------------------------------------------------------------
> Intel Corporation (UK) Limited
> Registered No. 1134945 (England)
> Registered Office: Pipers Way, Swindon SN3 1RJ
> VAT No: 860 2173 47
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
--
Elizabeth Flanagan
Yocto Project
Build and Release
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-03-19 15:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-19 14:03 [PATCH 2/2] buildslave-janitor: Add in try/except handling to make calls robust against failure Richard Purdie
2014-03-19 14:28 ` Burton, Ross
2014-03-19 15:38 ` Flanagan, Elizabeth
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.