Closed Bug 808040 Opened 12 years ago Closed 12 years ago

no active alerting on error conditions from vcs2vcs system

Categories

(Release Engineering :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: hwine, Assigned: hwine)

References

Details

(Whiteboard: [re-b2g])

Attachments

(1 file, 1 obsolete file)

see bug 807702 for user notification. Found errors in logs, but no notification was given.
Blocks: vcs-sync
New file - processes job log files in standard locations looking for failures of 'hg gexport' as run by do_update

First of the vcs2vcs files to be reviewed, so there may be a lot of context missing.
Assignee: nobody → hwine
Status: NEW → ASSIGNED
Attachment #678138 - Flags: review?(rail)
Attachment #678138 - Flags: feedback?(nthomas)
Comment on attachment 678138 [details]
cron script to monitor job files for serious errors

>USAGE="usage: ${##*/} [options] [log_file...]

Missing the 0 in ${0##*/}.

>    if test "$iso_time" = "${iso_time#20}"; then
>        # we have 'path/to/file:20' (assumes no ':' in path)
>        iso_time="20${iso_time#*:20}"
>    fi

egrep -h may avoid needing this, might need to pass it through sort depending on the ordering you want.

>while test $# -gt 0; do
>    case "$1" in
>    -h|--help) usage ;;
>    --email) addr+=("$2") ; shift ;;
>    --last) cutoff_time="$2" ; shift ;;
>    -*) usage "Unknown option '$1'" ;;
>    *) break ;;
>    esac

Some additional indentation would help readability in the case block.

># just egrep hack for now
>egrep -v ';0;[^0-9]' "${log_file_list[@]}" |
># only process failing gexport calls for now
>egrep ';hg .* gexport' |
># but only those as recent as specified
>toss_before $cutoff_time &>$tmp_file

Is this going to be easily extensible if you want to include other classes of errors ? Or need more context?
Attachment #678138 - Flags: feedback?(nthomas) → feedback+
All code/formatting changes made - following up on approach.

(In reply to Nick Thomas [:nthomas] from comment #2)
> Comment on attachment 678138 [details]

> 
> >    if test "$iso_time" = "${iso_time#20}"; then
> >        # we have 'path/to/file:20' (assumes no ':' in path)
> >        iso_time="20${iso_time#*:20}"
> >    fi
> 
> egrep -h may avoid needing this, might need to pass it through sort
> depending on the ordering you want.

I debated this - including the file name in the log output saves one lookup step in trouble shooting. But, there are "boot strap" issues on a new machine only runing one job for the first month (only 1 file will match, so file names are dropped by grep.

The current line ordering will help make obvious whether there error condition is persisting, or self correcting.

> ># just egrep hack for now
> >egrep -v ';0;[^0-9]' "${log_file_list[@]}" |
> ># only process failing gexport calls for now
> >egrep ';hg .* gexport' |
> ># but only those as recent as specified
> >toss_before $cutoff_time &>$tmp_file
> 
> Is this going to be easily extensible if you want to include other classes
> of errors ? Or need more context?

Actually, this is a copy/paste/modify from another utility script, so it is "extensible" ;) I can't project if the next show stopper we need to alert for will easily fit this pattern.

I decided to not over engineer at this point. We don't know all the error conditions yet, nor the way IT may require notifications and logging to be done. So this feels very temporary at the moment.

If it does need a longer life or much more complexity, then it needs to be rewritten in python.
Incorporated :nthomas feedback
Attachment #678138 - Attachment is obsolete: true
Attachment #678138 - Flags: review?(rail)
Attachment #678385 - Flags: review?
Attachment #678385 - Flags: review? → review?(rail)
Comment on attachment 678385 [details]
cron script to monitor job files for serious errors

Sorry for the delayed review.

Thanks to Nick's feedback, it's much easier to review the logic skipping the (ba)shizm where I'm not the best reviewer. :)

In overall it looks good.
Attachment #678385 - Flags: review?(rail) → review+
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Product: mozilla.org → Release Engineering
Component: Tools → General
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: