Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove files after build #5680
Remove files after build #5680
Changes from 11 commits
061066a
11debc3
0a6445e
e44120b
96ef713
b3c8d63
9bde8d3
726c7ea
ac79017
47f2b67
c425869
3f6095d
2bf07e5
b613bbb
955286a
9ba356c
f806708
ce44698
3245cd0
cd350c2
8558c20
caeb3ab
faedd02
eca17fe
a65dc38
2d6352d
167dcbf
478935d
9ca1107
3e3a532
2d045fa
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a doubt here.
I understand that when we receive a webhook this task is called to sync the versions. So, if the
default_version
is triggered for a build as well, it could happen that thisclean_build_task
removes the files while the build is still building.In other words, since calling
sync_versions
may trigger a build forstable
version, I think that there is one case where this could break. Consider this scenario:default_version
is set asstable
sync_versions
and it triggers a build forstable
stable
version starts in the same builderclean_build_task
is called withstable
version because it was thedefault_version
of the projectstable
version are removed from the builder while it was buildingI understand that if we merge #5695 as well (lock the whole build), step number 5) won't happen because
clean_build_task
tries to acquire the lock at this line: https://github.com/rtfd/readthedocs.org/pull/5680/files/0a6445edb9621256f28f673e1a9ae8d4a3831704..b613bbb98f99fb507fbe84826d8fa90de2db4358#diff-b9399e1d3499066c5564f98a620e8881R1434Please, double check this and confirm if I'm right or wrong. Although, it seems to be a very improbable case :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably we should only be cleaning up the files for the specific version we're building?
This is another vote for single build per builder in my mind. We're wasting a lot of time worrying about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm acquiring a lock for the clean build task in
https://github.com/rtfd/readthedocs.org/pull/5680/files#diff-b9399e1d3499066c5564f98a620e8881R1434
And skipping the deletion if there is another task with a lock. That avoids the problem of deleting stuff if we have another task expecting files to be there.
I only need to update the code acquire a lock in the sync_versions task after #5695, that way clean_build will skip the deletion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are doing that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are not locking the whole build, this can still happen in between the locks, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line will trigger a chain of
sync_repository_task
andclean_build_task
. How do we guarantee that these tasks are going to be executed both in the same server?