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

Clear cache if http client fails #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anthony-ism
Copy link

I noticed an issue with the lib, if my http client initially failed, it would never work from that point forward until the process was restarted.

This is an issue with the "AsynceCacheControl" lib, because it is waiting for a failed request to finish and that will never happen, however this lib could easily prevent this from happening with this PR.

To reproduce what I was seeing, in a docker container I removed the default gateway (disconnected from the internet) and attempted to verify a jwt. It fails, as it should because it cannot connect to the host. However, each subsequent failure is a "Timeout" failure, which originates here (https://github.com/MasterSergius/acachecontrol/blob/master/src/acachecontrol/cache.py#L131).

This is because cache contains this request, it doesn't even attempt the http call again because its waiting for the failed one to finish.

So even after the internet is reestablished it will not move passed the timeout issue until the process is restarted.

Hope this helps, and thanks for the lib!

Thanks!

@jrybinski
Copy link

Can we merge it? Please review @serhiibuniak-okta
We have problems with cached timeouts in the latest version. It would be nice to have it fixed.

@cbatal-tw
Copy link

We are also facing the same problem and it would be nice if we could get this fix in as well.

@bryanapellanes-okta are you possibly able to review this?

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.

3 participants