Skip to content

Commit b84ebeb

Browse files
ericholscheragjohnson
authored andcommitted
This fixes a bug where we weren't locking the Python env. (#2286)
This lead to the `Text File Busy` errors, because we were trying to create the virtualenv while another process was running. Instead of this throwing a "version locked" error and retrying, it was just failing because it was never checking for a lock properly.
1 parent 800f7b1 commit b84ebeb

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

readthedocs/projects/tasks.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,15 @@ def setup_environment(self):
297297
"""
298298
self.build_env.update_build(state=BUILD_STATE_INSTALLING)
299299

300-
self.python_env.delete_existing_build_dir()
301-
self.python_env.setup_base()
302-
self.python_env.install_core_requirements()
303-
self.python_env.install_user_requirements()
304-
self.python_env.install_package()
300+
with self.project.repo_nonblockinglock(
301+
version=self.version,
302+
max_lock_age=getattr(settings, 'REPO_LOCK_SECONDS', 30)):
303+
304+
self.python_env.delete_existing_build_dir()
305+
self.python_env.setup_base()
306+
self.python_env.install_core_requirements()
307+
self.python_env.install_user_requirements()
308+
self.python_env.install_package()
305309

306310
def build_docs(self):
307311
"""Wrapper to all build functions

0 commit comments

Comments
 (0)