-
Notifications
You must be signed in to change notification settings - Fork 186
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
Fix race condition in AWS request signers #470
Fix race condition in AWS request signers #470
Conversation
9293581
to
106f3b8
Compare
Signed-off-by: Logan Attwood <logan.attwood@gmail.com>
Signed-off-by: Logan Attwood <logan.attwood@gmail.com>
106f3b8
to
dd325ed
Compare
[2.3.0]: https://github.com/opensearch-project/opensearch-py/compare/v2.2.0...v2.3.0 |
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.
This showed up because my local vim
doesn't like it when a file doesn't end in a newline- I'm guessing most the devs on this project are using VSCode
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's fine.
Codecov Report
@@ Coverage Diff @@
## main #470 +/- ##
=======================================
Coverage 70.91% 70.92%
=======================================
Files 81 81
Lines 7730 7732 +2
=======================================
+ Hits 5482 5484 +2
Misses 2248 2248
|
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.
Looks good!
There's a bit of code duplication, but I suppose it's ok here. LMK if you want to leave things as is in the test, and I'll merge?
[2.3.0]: https://github.com/opensearch-project/opensearch-py/compare/v2.2.0...v2.3.0 |
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's fine.
access_key = uuid.uuid4().hex | ||
secret_key = uuid.uuid4().hex | ||
token = uuid.uuid4().hex | ||
dummy_session = Mock() | ||
dummy_session.access_key = access_key | ||
dummy_session.secret_key = secret_key | ||
dummy_session.token = token | ||
dummy_session.get_frozen_credentials = Mock(return_value=dummy_session) | ||
|
||
if disable_get_frozen: |
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.
There's probably a cleaner way to do this, if you care, by inheriting TestAsyncSigner
into a TestAsyncSignerWithFrozenCredentials(TestAsyncSigner)
or something like that?
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.
Hrm. The issue is the checks for the get_frozen_credentials
method in the signer implementations will always evaluate to True
if I don't explicitly delete the attribute because of how eager Mock
is to mock :)
@dblock unless you can think of a better solution to |
Figured it out, another commit will be forthcoming |
28ea160
to
5cba13f
Compare
Signed-off-by: Logan Attwood <logan.attwood@gmail.com>
doing one more force push to retrigger that failing integration test |
5cba13f
to
32074ec
Compare
This failure has been so annoying. Hope someone can make the test more reliable. Wink wink. |
Looks like it's related to docker networking stuff 😅 |
AFAIK no, we release from main, @VachaShah yes? |
was why I asked (CONTRIBUTING.md) |
Good work @lattwood ! Also great GitHub profile blurb. You're talking to an LLM btw here ;) |
Yeah no backports are required currently as we release from main since there have been no breaking changes in this client, so main = 2.x. |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.3 2.3
# Navigate to the new working tree
cd .worktrees/backport-2.3
# Create a new branch
git switch --create backport/backport-470-to-2.3
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 fca8bd3d0e7f42f2458e924c36ac6a135a6bc622
# Push it to GitHub
git push --set-upstream origin backport/backport-470-to-2.3
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.3 Then, create a pull request where the |
Closes #423