pex-tool / pex

A tool for generating .pex (Python EXecutable) files, lock files and venvs.
https://docs.pex-tool.org/
Apache License 2.0
2.5k stars 257 forks source link

Create SSLContexts in the main thread. #2356

Closed jsirois closed 5 months ago

jsirois commented 5 months ago

This solves #2355 without yet understanding why that issue exists.

Fixes #2355

jsirois commented 5 months ago

With just the 1st commit (the failing test / repro):

$ tox -epy311-integration -- --devpi -vvsk test_issue_2355 -n0
...
============================================================================================== test session starts ===============================================================================================
platform linux -- Python 3.11.7, pytest-7.4.0, pluggy-1.4.0 -- /home/jsirois/dev/pantsbuild/jsirois-pex/.tox/py311-integration/bin/python
cachedir: .tox/py311-integration/.pytest_cache
rootdir: /home/jsirois/dev/pantsbuild/jsirois-pex
plugins: xdist-1.34.0, forked-1.6.0
collected 671 items / 670 deselected / 1 selected

[+] Building 0.1s (6/6) FINISHED                                                                                                                                                                   docker:default
 => [internal] load .dockerignore                                                                                                                                                                            0.0s
 => => transferring context: 2B                                                                                                                                                                              0.0s
 => [internal] load build definition from Dockerfile                                                                                                                                                         0.0s
 => => transferring dockerfile: 321B                                                                                                                                                                         0.0s
 => [internal] load metadata for docker.io/library/fedora:37                                                                                                                                                 0.0s
 => [1/2] FROM docker.io/library/fedora:37                                                                                                                                                                   0.0s
 => CACHED [2/2] RUN curl --fail -sSL -O https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.9.18+20240107-x86_64-unknown-linux-gnu-install_only.tar.gz && curl --fail  0.0s
 => exporting to image                                                                                                                                                                                       0.0s
 => => exporting layers                                                                                                                                                                                      0.0s
 => => writing image sha256:316fa459f8410db8e347fe50ab51147145d003dfe59424ca213e6cc8eb5a0f84                                                                                                                 0.0s
 => => naming to docker.io/library/test_issue_2355                                                                                                                                                           0.0s
Failed to spawn a job for /usr/bin/python3.11: unknown error (_ssl.c:3161)
FAILED
...