Closed Bug 1080951 Opened 10 years ago Closed 10 years ago

Add fabric action to reset the timestamp used by buildbot-master exception log reporting

Categories

(Infrastructure & Operations Graveyard :: CIDuty, task, P2)

x86
macOS

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: coop, Assigned: coop)

Details

Attachments

(1 file)

While we're waiting on me for the fix in bug 1076623, it would be useful to unblock exception reporting by updating the last-time.txt file on each master via fabric. This file contains an epoch tiemstamp that determines how far back in the logs to look for exceptions.

Patch incoming.
Ran this successfully after the db outage today to clean up the exception mailings.
Attachment #8502929 - Flags: review?(pmoore)
Comment on attachment 8502929 [details] [diff] [review]
Update the exception timestamp.

Review of attachment 8502929 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks Coop!

r+ with nits

::: lib/python/util/fabric/actions.py
@@ +230,5 @@
>  
>  
> +def action_update_exception_timestamp(master):
> +    with show('running'):
> +        run('echo `date +%s` > ' +  '`ls -1 /home/cltbld/.%(name)s-last-time.txt`' % master)

Nit: There are two spaces after the +
Nit: Echo not needed, you can run date command directly
Nit: -1 not needed, because without wildcards ls returns maximum of one file
Nit: Having ls ensures that only an existing file is updated, but will cause errors if it does not exist. I've checked and see that the file exists on all the masters, so I think the ls check is not needed. If it is needed, we should not show errors if file does not exist.

Alternatives:

run('date +%s > /home/cltbld/.' + master['name'] + 's-last-time.txt') # preferred
run('date +%s > /home/cltbld/.{0}s-last-time.txt'.format(master['name']))
Attachment #8502929 - Flags: review?(pmoore) → review+
Comment on attachment 8502929 [details] [diff] [review]
Update the exception timestamp.

Review of attachment 8502929 [details] [diff] [review]:
-----------------------------------------------------------------

Landed with nits fixed:

https://hg.mozilla.org/build/tools/rev/eb6fb1412521
Attachment #8502929 - Flags: checked-in+
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Product: Release Engineering → Infrastructure & Operations
Product: Infrastructure & Operations → Infrastructure & Operations Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: