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

Issue a purge request when we get a stale serial. #57

Merged
merged 4 commits into from
Oct 18, 2018

Conversation

Xcelled
Copy link
Contributor

@Xcelled Xcelled commented Oct 17, 2018

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.

Copy link
Contributor

@cooperlees cooperlees left a 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.

logger.warning(
"Got an error when attempting to clear the cache", exc_info=True
)

raise StalePage(
"Expected PyPI serial {} for request {} but got {}".format(
Copy link
Contributor

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)

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@cooperlees cooperlees left a 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.

@TechCiel
Copy link
Contributor

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

@cooperlees
Copy link
Contributor

cooperlees commented Dec 30, 2022

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.

@ichard26
Copy link
Member

ichard26 commented Jan 3, 2023

[...] Naught me should have cut an issue. [...]

#1334 there ya go!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants