Skip to content

Use an asyncio lock for backoff-based refresh token attempts - #267

Merged
bachya merged 4 commits into
devfrom
refresh-lock
Oct 7, 2021
Merged

bachya merged 4 commits into
devfrom
refresh-lock

Conversation

@bachya

@bachya bachya commented Oct 7, 2021 •

Copy link
Copy Markdown
Owner

Describe what the PR does:

Even though #266 was a needed fix, there was still a possibility that multiple "backing-off" requests could attempt the refresh token flow at the same time (causing the same problem that #266 was trying to solve). This PR augments things with an asyncio lock to ensure that only one such task can attempt to refresh at a given time.

Also, since I'm in here, this PR expands the access token expiration padding to give us a little more room.

Does this fix a specific issue?

N/A

Checklist:

  • Confirm that one or more new tests are written for the new functionality.
  • Run tests and ensure everything passes (with 100% test coverage).
  • Update README.md and docs/ with any new documentation.
  • Add yourself to AUTHORS.md.

@bachya bachya added the bug Bugs or issues which will cause a problem for users label Oct 7, 2021
@bachya bachya self-assigned this Oct 7, 2021
@codecov

codecov Bot commented Oct 7, 2021 •

Copy link
Copy Markdown

Codecov Report

Merging #267 (8965c15) into dev (2300382) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##               dev      #267   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           13        13           
  Lines          893       897    +4     
=========================================
+ Hits           893       897    +4     
Impacted Files Coverage Δ
simplipy/api.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2300382...8965c15. Read the comment docs.

@qlty-cloud-legacy

Copy link
Copy Markdown

Code Climate has analyzed commit 8965c15 and detected 0 issues on this pull request.

View more on Code Climate.

@bachya
bachya merged commit 6291c1e into dev Oct 7, 2021
@bachya
bachya deleted the refresh-lock branch October 7, 2021 06:18
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Bugs or issues which will cause a problem for users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant