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

Do not fail when unlinking an non-existing path #4760

Merged
merged 2 commits into from Oct 16, 2018
Merged

Conversation

@humitos
Copy link
Member

@humitos humitos commented Oct 16, 2018

If we try to unlink a path that doesn't exist, we need to do nothing instead of failing hard and logging an exception on Sentry.

This has generated more than 6.5k Sentry logs.

I'm not sure about the causes of this, but I guess that bots/spam has something to do here. I think the whole project is completely deleted before the celery task that removes the symlinks is executed and that makes the unlink to fail.

If we try to unlink a path that doesn't exist, we need to do nothing
instead of failing hard and logging an exception on Sentry.
@humitos humitos requested a review from Oct 16, 2018
@@ -63,7 +63,7 @@

from readthedocs.builds.models import Version
from readthedocs.core.utils.extend import SettingsOverrideObject
from readthedocs.core.utils import safe_makedirs
from readthedocs.core.utils import safe_makedirs, unlink
Copy link
Member

@ericholscher ericholscher Oct 16, 2018

Choose a reason for hiding this comment

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

Should this be called safe_unlink to mirror the safe_makedirs and show it has a bit more error handling?

Loading

@ericholscher ericholscher merged commit 846c7e2 into master Oct 16, 2018
1 check passed
Loading
@humitos humitos deleted the humitos/symlink/unlink branch Oct 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants