Borrow asyncio ssl implementation from uvloop #88177
Copy link
Copy link
Closed
Labels
3.11only security fixesonly security fixestopic-asynciotype-featureA feature request or enhancementA feature request or enhancement
Description
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = 'https://github.com/asvetlov'
closed_at = <Date 2022-02-22.21:12:45.984>
created_at = <Date 2021-05-02.20:33:39.996>
labels = ['3.11', 'type-feature', 'expert-asyncio']
title = 'Borrow asyncio ssl implementation from uvloop'
updated_at = <Date 2022-02-26.13:06:50.530>
user = 'https://github.com/asvetlov'bugs.python.org fields:
activity = <Date 2022-02-26.13:06:50.530>
actor = 'asvetlov'
assignee = 'asvetlov'
closed = True
closed_date = <Date 2022-02-22.21:12:45.984>
closer = 'asvetlov'
components = ['asyncio']
creation = <Date 2021-05-02.20:33:39.996>
creator = 'asvetlov'
dependencies = []
files = []
hgrepos = []
issue_num = 44011
keywords = ['patch']
message_count = 18.0
messages = ['392726', '392739', '392769', '392771', '392774', '392775', '392776', '392798', '392799', '392800', '392802', '392813', '392815', '413062', '413065', '413288', '413289', '414102']
nosy_count = 4.0
nosy_names = ['asvetlov', 'yselivanov', 'pablogsal', 'kumaraditya']
pr_nums = ['17975', '25840', '25842', '25846', '25848', '31275', '31597']
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue44011'
versions = ['Python 3.11']Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
3.11only security fixesonly security fixestopic-asynciotype-featureA feature request or enhancementA feature request or enhancement
Activity
asvetlov commentedon May 2, 2021
There is a PR created a long time ago.
Finally, I've ported tests for it also.
The documentation doesn't mention new ssh_shutdown_timeout parameter yet.
The latest changes from MagicStack/uvloop#385 can be applied separately.
asvetlov commentedon May 2, 2021
New changeset 5fb06ed by Andrew Svetlov in branch 'master':
bpo-44011: New asyncio ssl implementation (bpo-17975)
5fb06ed
tiran commentedon May 3, 2021
The commit has broken multiple build bots, e.g .https://buildbot.python.org/all/#/builders/345/builds/134/steps/5/logs/stdio The new code is missing checks for presence of ssl module. It's an optional component.
tirkarthi commentedon May 3, 2021
The PR made sslproto a hard dependency that even import asyncio fails on non-ssl builds and thus anything that indirectly import asyncio also fails. It seems some of the test modules can be skipped. Some parts of the asyncio codebase already has checks for ssl and has to be done for new parts. Attached is a patch to add more checks but it will be helpful to ensure only relevant parts that absolutely require ssl are skipped.
The test_make_socket_transport is slightly tricky since it tries to simulate ssl being not present by patching it but mock does import of sslproto which will fail since SSLAgainErrors is initialized at module level. Perhaps the test can be modified better to only mock if ssl is not present.
tiran commentedon May 3, 2021
PR #70027 fixes most issues. Gentoo with X buildbot https://buildbot.python.org/all/#builders/465/builds/23 has one failing test.
======================================================================
ERROR: test_create_server_ssl_over_ssl (test.test_asyncio.test_ssl.TestSSL)
----------------------------------------------------------------------
tiran commentedon May 3, 2021
New changeset 37ebdf0 by Christian Heimes in branch 'master':
bpo-44011: Fix asyncio tests without ssl module (GH-25840)
37ebdf0
tiran commentedon May 3, 2021
I have merged my PR to unblock buildbots. Karthikeyan has made suggestions how to improve the tests even further. CI also had some issues with OpenSSL 3.0.0-alpha15. Please run the tests with new OpenSSL version, too. "make multissltest" automates download, compilation, local installation, and testing.
4 remaining items
pablogsal commentedon May 3, 2021
Specifically this part of both messages:
pablogsal commentedon May 3, 2021
New changeset 7719953 by Pablo Galindo in branch 'master':
bpo-44011: Revert "New asyncio ssl implementation (GH-17975)" (GH-25848)
7719953
pablogsal commentedon May 3, 2021
Unfortunately I have reverted 5fb06ed commit to unblock the beta release :(
I know that nobody wants this but my responsibilities as a release manager is to safeguard the stability of the release and we are too close to the beta release to do all the testing we need, giving that many buildbots have been broken in a short timespan.
Andrew, we can try to get your PR merge between beta 1 and beta 2 but once we have done extensive testing and we know that there will be no impact on the buildbots and the CI.
Thank you all for your understanding
kumaraditya303 commentedon Feb 11, 2022
Since it was reverted as it was beta period, Can this be committed again as 3.11 is in alpha currently? @asvetlov
kumaraditya303 commentedon Feb 11, 2022
I created a draft PR by rebasing the old implementation of 3.10 for 3.11 so we can investigate the build-bots failure and fix them so this can be committed for 3.11.
See #31275
asvetlov commentedon Feb 15, 2022
New changeset 13c10bf by Kumar Aditya in branch 'main':
bpo-44011: New asyncio ssl implementation (bpo-31275)
13c10bf
asvetlov commentedon Feb 15, 2022
The code had landed.
Need a follow-up PR with documentation update (mention new ssl_shutdown_timeout arguments)
asvetlov commentedon Feb 26, 2022
New changeset 41ddcd3 by Kumar Aditya in branch 'main':
bpo-44011: Document ssl_shutdown_timeout added by revisited asyncio SSL implementation (GH-31597)
41ddcd3