-
Notifications
You must be signed in to change notification settings - Fork 27
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
♻️ Fixes deprecation warning of aiohttp client session #5321
♻️ Fixes deprecation warning of aiohttp client session #5321
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5321 +/- ##
========================================
- Coverage 87.3% 87.3% -0.1%
========================================
Files 1320 1320
Lines 54073 54063 -10
Branches 1174 1172 -2
========================================
- Hits 47212 47202 -10
- Misses 6610 6611 +1
+ Partials 251 250 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
8c36de4
to
4a0ba94
Compare
|
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.
Thanks!
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.
thanks
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.
Thanks a lot.
What do these changes do?
Fixes long standing deprecation warning on
aiohttp.ClientSession()
(more details in issue below). This change required a small redesign. This is the idea: Basically anaiohttp
application created usingapp = create_safe_application()
injects an eventapp.cleanup_ctx.append(persistent_client_session)
to create anaiohttp.ClientSession
that is attached to the lifespam of the application, i.e. a unique client session that is started and closed with the application. This is the only session used for all communications with other internal or external services. After the app starts, the session is ready and can be obtained usingget_client_session
. This pattern is used in all the aiohttp-based apps, i.e.web-server
andstorage
.This fix might unblock upgrading
aiohttp
#5206Related issue/s
How to test
packages/service-library/tests/aiohttp/test_application.py
Dev Checklist
DevOps Checklist