Skip to content

Commit

Permalink
xvfb: improve robustness when stale lock files exist
Browse files Browse the repository at this point in the history
This ports https://codereview.chromium.org/2153083002
to src-side xvfb.py .

BUG=630698, 628517

Review-Url: https://codereview.chromium.org/2216543002
Cr-Commit-Position: refs/heads/master@{#409767}
  • Loading branch information
phajdan.jr authored and Commit bot committed Aug 4, 2016
1 parent bd3b430 commit 5916a64
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions infra/scripts/legacy/scripts/slave/xvfb.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ def StartVirtualX(slave_build_name, build_dir, with_wm=True, server_dir=None):
print 'xdisplaycheck says there is a display still running, exiting...'
raise Exception('Display already present.')

xvfb_lock_filename = '/tmp/.X%s-lock' % _XvfbDisplayIndex(slave_build_name)
if os.path.exists(xvfb_lock_filename):
print 'Removing stale xvfb lock file %r' % xvfb_lock_filename
try:
os.unlink(xvfb_lock_filename)
except OSError as e:
print 'Removing xvfb lock file failed: %s' % e

# Figure out which X server to try.
cmd = 'Xvfb'
if server_dir and os.path.exists(server_dir):
Expand Down

0 comments on commit 5916a64

Please sign in to comment.