From python3.11.spec: # 00371 # c1754d9c2750f89cb702e1b63a99201f5f7cff00 # Revert "bpo-1596321: Fix threading._shutdown() for the main thread (GH-28549) (GH-28589)" # # This reverts commit 38c67738c64304928c68d5c2bd78bbb01d979b94. It # introduced regression causing FreeIPA's tests to fail. # # For more info see: # https://bodhi.fedoraproject.org/updates/FEDORA-2021-e152ce5f31 # https://github.com/GrahamDumpleton/mod_wsgi/issues/730 Patch371: 00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch
Previously tracked in BZ#1287556.
The revert was motivated by a FreeIPA+mod_wsgi failure. First report of this issue: https://bodhi.fedoraproject.org/updates/FEDORA-2021-e152ce5f31#comment-2278745 Lumir then reported the issue to mod_wsgi: https://github.com/GrahamDumpleton/mod_wsgi/issues/730 mod_wsgi shutdown was modified in version 4.9.1 to better handle Python 3.9 shutdown: https://modwsgi.readthedocs.io/en/master/release-notes/version-4.9.1.html#features-changed Fedora 36 provides python3-mod_wsgi version 4.9.0-3.fc36.
> Fedora 36 provides python3-mod_wsgi version 4.9.0-3.fc36. That was not good enough to remove the patch, see bz2100282.
I tried to reproduce the issue, but so far I failed. == Step 1: Install FreeIPA and test it without the bug == I installed a fresh Fedora 38 VM. I set the hostname to "server.ipa.test" and I added "192.168.122.17 server.ipa.test" to /etc/hosts. The "server.ipa.test" hostname must not be used as localhost in /etc/hosts. I ran the following commands as root to install FreeIPA: --- firewall-cmd --add-service=freeipa-ldap --add-service=freeipa-ldaps firewall-cmd --add-service=freeipa-ldap --add-service=freeipa-ldaps --permanent dnf install freeipa-server ipa-server-install --- I added "vstinner" user. I tested kinit: --- [vstinner@server ~]$ kinit admin Password for admin: --- It works. I tested a different user: --- [vstinner@server ~]$ kinit vstinner Password for vstinner: --- It works as well. On the host, my laptop, I added "server.ipa.test" hostname to /etc/hosts as 127.0.0.1: --- 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 server.ipa.test --- To test the web interface, I ran the following command to expose VM tcp/443 as tcp/443 local port on the host (my laptop): sudo ssh -L 443:localhost:443 vstinner@fedora I open https://server.ipa.test/ipa/ui/ in Firefox: * I log in as "admin" * The UI lists users * I can see an user details by clicking on an user == Step 2: try to reproduce the bug == To introduce the bug, I built Python manually: --- wget 'https://www.python.org/ftp/python/3.11.6/Python-3.11.6.tar.xz' tar -xf Python-3.11.6.tar.xz cd Python-3.11.6 ./configure --prefix /usr --with-platlibdir=lib64 --libdir=/usr/lib64 --enable-shared make -j8 --- I created a backup of system Python in ~/BACKUP: --- mkdir ~/BACKUP cd ~/BACKUP cp /usr/bin/python3.11 . cp /lib64/libpython3.11.so.1.0 . --- I override Python with: --- SRC=/home/vstinner/Python-3.11.6 # needed to override /usr/bin/python3.11 program sudo systemctl stop ipa sudo systemctl stop firewalld sudo cp $SRC/python /usr/bin/python3.11 sudo cp $SRC/libpython3.11.so.1.0 /lib64/libpython3.11.so.1.0 --- Then I restarted FreeIPA and firewalld: --- sudo systemctl start ipa sudo systemctl start firewalld --- I did again kinit and web UI tests. Finally, I tried to reproduce the bug with: --- [vstinner@server ~]$ time sudo systemctl stop ipa real 0m3.970s user 0m0.014s sys 0m0.019s --- Problem: FreeIPA stops in less than 5 seconds, it does not time out after 90 seconds. My test is incomplete.
Links about this issue: * https://bodhi.fedoraproject.org/updates/FEDORA-2021-e152ce5f31 * https://pagure.io/freeipa/issue/9034 * https://github.com/GrahamDumpleton/mod_wsgi/issues/730 * https://src.fedoraproject.org/rpms/python3.11/blob/rawhide/f/00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch * https://bugzilla.redhat.com/show_bug.cgi?id=2133853
For the record, when upgrading python3.13 from 3.13.0a5 to 3.13.0a6, we removed the patch/revert, as it no longer applies at all after https://github.com/python/cpython/commit/33da0e844c922b3dcded75fbb9b7be67cb013a17 We need to monitor the freeipa situation and rework the patch entirely in case it is still needed. I am setting this to block the PYTHON3.13 tracker, not to forget.
Testing with OpenQA + Python 3.13 Copr. It works now without the patch. https://openqa.stg.fedoraproject.org/tests/3847928 It seems that we no longer need the patch.