Closed Bug 788020 Opened 12 years ago Closed 12 years ago

Clean up tbpl-base.pp & fix a race condition

Categories

(Tree Management Graveyard :: TBPL, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: emorley)

References

Details

Attachments

(2 files, 1 obsolete file)

Whilst testing bug 718632 using Vagrant, a few of the times when I started from a fresh VM, I got things like:

{
Traceback (most recent call last):
  File "/var/www/tbpl/dataimport/import-buildbot-data.py", line 382, in <module>
    main()
  File "/var/www/tbpl/dataimport/import-buildbot-data.py", line 307, in main
    db = options.dbname)
  File "/usr/lib/pymodules/python2.6/MySQLdb/__init__.py", line 81, in Connect
    return Connection(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/MySQLdb/connections.py", line 170, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)")
}

{
Fetching http://builddata.pub.build.mozilla.org/buildjson/builds-4hr.js.gz ...
Traversing runs and inserting into database...
Inserted 2437 new run entries.
Traversing builders and updating database...
Updated 1161 builders.
Fetching http://builddata.pub.build.mozilla.org/buildjson/builds-2012-09-03.js.gz ...
Fetching http://builddata.pub.build.mozilla.org/buildjson/builds-2012-09-02.js.gz ...
Traversing runs and inserting into database...
Inserted 6108 new run entries.
Traversing builders and updating database...
Updated 882 builders.
command failed: php /var/www/tbpl/dataimport/../php/getLogExcerpt.php id=14926709&type=annotated
command failed: php /var/www/tbpl/dataimport/../php/getLogExcerpt.php id=14926711&type=annotated
command failed: php /var/www/tbpl/dataimport/../php/getLogExcerpt.php id=14926710&type=annotated
}

I believe these to be due to the import-buildbot-data.py step being run before all the required packages are installed.

In addition, I spotted that at present the cron job can start before import-buildbot-data.py has finished, in the initial import takes long enough (which is now more likely after bug 718632).
Attached patch Patch v1 (obsolete) — Splinter Review
* Ensures import-buildbot-data.py waits until the required packages are installed.
* Makes the cron job wait until the import-buildbot-data.py step has finished.
Assignee: nobody → bmo
Status: NEW → ASSIGNED
Attachment #657933 - Flags: review?(rhelmer)
Comment on attachment 657933 [details] [diff] [review]
Patch v1

The initial import can sometimes take longer than the default 300s timeout. Will sort out a revised patch tomorrow.
Attachment #657933 - Flags: review?(rhelmer)
> The initial import can sometimes take longer than the default 300s timeout.

...which isn't due to this bug; however the corrected dependencies means that if the data import /does/ timeout, then the cron job is never added.
Timeouts due to prefetching fixed by bug 790895.
Depends on: 790895
* Fixes indentation
* Per puppet style guide:
** Makes sure all strings are quoted
** Lists permissions as four digits
Attachment #657933 - Attachment is obsolete: true
Attachment #660807 - Flags: review?(rhelmer)
* Ensures import-buildbot-data.py waits until the required packages are installed.
* Makes the cron job wait until the import-buildbot-data.py step has finished.
Attachment #660808 - Flags: review?(rhelmer)
Attachment #660808 - Flags: review?(rhelmer) → review+
Attachment #660807 - Flags: review?(rhelmer) → review+
Thank you for the reviews :-)

http://hg.mozilla.org/users/mstange_themasta.com/tinderboxpushlog/rev/fa50a59f2099
http://hg.mozilla.org/users/mstange_themasta.com/tinderboxpushlog/rev/e7c29bfd21b1
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Depends on: 791282
Product: Webtools → Tree Management
Product: Tree Management → Tree Management Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: