OpenSolaris

Printable Version Enter a New Search
Bug ID 6581614
Synopsis create_lock() in nightly is racy
State 10-Fix Delivered (Fix available in build)
Category:Subcategory consolidation:os-net-tools
Keywords
Responsible Engineer Danek Duvall
Reported Against
Duplicate Of
Introduced In solaris_10
Commit to Fix snv_70
Fixed In snv_70
Release Fixed solaris_nevada(snv_70)
Related Bugs 4739385 , 4801981 , 6616010
Submit Date 17-July-2007
Last Update Date 8-August-2007
Description
Lock creation in the create_lock() function in nightly is racy.  In particular, lock creation isn't
atomic.  Not only is the test a separate operation from the set, but the set itself isn't atomic,
as it consists of writing to a file.

Given that we want to store data in the lock, a symlink is the best means available to us.  Symlink
creation as our test-and-set is completely atomic, and even embeds the lock data atomically.

While the current mechanism is fine for accidentally running nightly on a workspace whose build is
already some time in progress -- likely the majority of the cases -- I've run into the problem
dozens of times because of the ON incremental builds, which are run from a cron job.  When my
home directory disappears (because of a jurassic or network outage), the cron jobs pile up, and when
my home directory reappears, they all thunder towards this lock at pretty much the same time.  With
the patch in the Suggested Fix applied, only one nightly actually succeeds, saving the workspace
from some pretty scary consequences.
Work Around
N/A
Comments
N/A