Swarming bot: do not release the singleton lock when self-updating on POSIX |
|
Issue descriptionIssue 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 |
|
►
Sign in to add a comment |
|
Comment 1 by mar...@chromium.org
, Jun 22 2018