-
Notifications
You must be signed in to change notification settings - Fork 141
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
Issue a purge request when we get a stale serial. #57
Conversation
81550eb
to
a892bda
Compare
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.
Thanks for working on this!
I will accept once we get the logging (as I don’t run in debug in prod). When I merge I’ll open a Issue with warehouse and work with @dstufft + others to try and root cause and work to remove this.
src/bandersnatch/master.py
Outdated
logger.warning( | ||
"Got an error when attempting to clear the cache", exc_info=True | ||
) | ||
|
||
raise StalePage( | ||
"Expected PyPI serial {} for request {} but got {}".format( |
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.
Can we add to the exception message that we’ve sent a PURGE (more to remind me / other devs in the future)
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.
Yeah but iirc the stalepage exception is just swallowed, so the message isn't seen.
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.
It will if you have stop-on-error
set in the config file.
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.
Done.
97b1f84
to
4031009
Compare
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.
LGTM - Will merge for now.
Now PURGE is no more open but requiring credentials, so this HACK leads to 401 error flooding the log. Shall we consider removal of this workaround? see also: #1220 About the root cause, have a look at pypi/warehouse#12214 |
I did see this was removed, forgot about it. Naughty me should have cut an issue. I’d be more than happy to pull it out and release a new minor version. PR welcome. Will cleanup the code too and stop wasting peoples resources trying. |
#1334 there ya go! |
Temporary fix for #56. We issue a PURGE to the url if we get a stale serial. Not ideal, but a workaround until PyPI's caches are fixed to always return the up-to-date header.