Skip to content
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

Ensure repo deletion doesn't fail due to the absence of listing files #1748

Merged
merged 1 commit into from
Jun 23, 2020

Conversation

goosemania
Copy link
Member

try:
os.rmdir(up_dir)
except OSError:
# If this happened, there was a concurrency issue and it is no longer safe to
# remove the directory. It is possible that the concurrent operation created the
# listing file before this operation deleted it, so to be safe, we need to
# regenerate the listing file.
util.generate_listing_files(up_dir, up_dir)
try:
util.generate_listing_files(up_dir, up_dir)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to race condition, we can't safely fail earlier.

@pulpbot
Copy link
Member

pulpbot commented Jun 15, 2020

Attached issue: https://pulp.plan.io/issues/2826

@goosemania goosemania merged commit 8c23673 into pulp:2-master Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants