New issue
Advanced search Search tips

Issue 855022 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Swarming bot: do not release the singleton lock when self-updating on POSIX

Project Member Reported by mar...@chromium.org, Jun 21 2018

Issue description

 Issue 854352  was caused because there is a small window at which the singleton lock file 'swarming.lck' is not held.

The window is between these two calls is:
parent process:
https://chromium.googlesource.com/infra/luci/luci-py.git/+/340c674f10fd758340d56d877cee2076d349e977/appengine/swarming/swarming_bot/bot_code/bot_main.py#1267

child process:
https://chromium.googlesource.com/infra/luci/luci-py.git/+/340c674f10fd758340d56d877cee2076d349e977/appengine/swarming/swarming_bot/bot_code/bot_main.py#1381


Goal:
- Keep the lock continuously held while the bot is self-updating.


AIs:
- Instead of releasing the lock, keep it open as the execv() in common.exec_python() will keep the file handle open. Do not use close_fds=True.
- On Windows, this is more complicated. https://www.python.org/dev/peps/pep-0446/#inheritance-of-file-descriptors-on-windows has some details. It's fine to keep the current behavior there for now.


Ref:
https://chromium.googlesource.com/infra/luci/luci-py.git/+/340c674f10fd758340d56d877cee2076d349e977/appengine/swarming/swarming_bot/bot_code/common.py#23
 

Comment 1 by mar...@chromium.org, Jun 22 2018

Cc: bpastene@chromium.org

Sign in to add a comment