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

FIX: Remove HEAD -> GET request swap workaround #699

Closed
wants to merge 1 commit into from

Conversation

vcastane
Copy link
Contributor

Description

Remove a workaround replacing HEAD requests with GET requests for async requests.
This workaround is no longer needed after the underlying bug was fixed in aio-libs/aiohttp#5012

Issues Resolved

Partially resolves #698
The rest of the issue is user (my) error.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@vcastane vcastane changed the title remove HEAD -> GET workaround FIX: Remove HEAD -> GET request swap workaround Mar 20, 2024
Copy link

codecov bot commented Mar 20, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 72.16%. Comparing base (bd91530) to head (9560795).
Report is 52 commits behind head on main.

Files Patch % Lines
opensearchpy/_async/http_aiohttp.py 50.00% 1 Missing ⚠️
opensearchpy/connection/http_async.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #699      +/-   ##
==========================================
+ Coverage   72.14%   72.16%   +0.01%     
==========================================
  Files          89       89              
  Lines        7945     7943       -2     
==========================================
  Hits         5732     5732              
+ Misses       2213     2211       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

Do we need to lock aiohttp >= a certain version as part of the PR?

await response.release()
raw_data = ""
raw_data = "" # HEAD method has no response body
Copy link
Member

Choose a reason for hiding this comment

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

Should be None? There other other places where we assign things to "" where in fact we mean none I believe, too.

@@ -246,12 +246,8 @@ async def perform_request(
else:
query_string = ""

# There is a bug in aiohttp that disables the re-use
# of the connection in the pool when method=HEAD.
# See: aio-libs/aiohttp#1769
is_head = False
Copy link
Member

Choose a reason for hiding this comment

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

I believe this is no longer needed as we only reuse it once, maybe just check the verb where it's needed?

@dblock
Copy link
Member

dblock commented Mar 20, 2024

Is there a way to write a test for this, too? Something that fails without this change?

@saimedhi
Copy link
Collaborator

saimedhi commented Apr 1, 2024

Do we need to lock aiohttp >= a certain version as part of the PR?

  • Bug resolved in aiohttp version 3.7.0.
  • opensearch-py compatibility: aiohttp>=3,<4.
  • I suggest instead of locking aiohttp to >=3.7.0,<4, we should check the aiohttp version and conditionally remove the workaround for aiohttp >=3.7.0.
  • Detailed code review required to identify necessary code changes.

@saimedhi
Copy link
Collaborator

saimedhi commented Apr 2, 2024

  • I suggest instead of locking aiohttp to >=3.7.0,<4, we should check the aiohttp version and conditionally remove the workaround for aiohttp >=3.7.0.

Disregard the previous comment. To resolve this issue #715 , we're planning to lock aiohttp to >=3.9.2,<4. Thus, simply removing the workaround should suffice."

@saimedhi
Copy link
Collaborator

Hello @vcastane ,

Could you please take a look at finishing this PR when you have a moment? If you need any help, let us know.

Thanks a lot!

@dblock
Copy link
Member

dblock commented Aug 15, 2024

Finished this in #794.

@dblock dblock closed this in #794 Aug 15, 2024
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.

[BUG] AsyncOpenSearch Authorization Error When Using AWSV4SignerAsyncAuth
3 participants