commit 6c433ca9c65e6bb24cc29c6c45dbe93cf2292a75 Author: Alexandre Rossi <alexandre.rossi@gmail.com> Date: Mon Sep 30 15:26:43 2024 +0200 remove apache2 modules building related variable commit b35d3f7b13161e929cdbd74f6fb6304ef7412f85 Author: Alexandre Rossi <alexandre.rossi@gmail.com> Date: Sat Sep 28 15:36:59 2024 +0200 refresh patches commit ad737c942c94c283dcbc664c51fb189c1b7c57d7 Author: Alexandre Rossi <alexandre.rossi@gmail.com> Date: Sat Sep 28 15:34:01 2024 +0200 autopkgtest: only test the python3 plugin commit 10e3fc1157cf27620b0dd764dfdad0d0620ca84a Author: Alexandre Rossi <alexandre.rossi@gmail.com> Date: Sat Sep 28 15:31:26 2024 +0200 add 2002_rename_py_plugins.patch to ensure stable py plugins name for users commit 89c45f77969b301d2a3b2432a35a542db797aae0 Author: Alexandre Rossi <alexandre.rossi@gmail.com> Date: Sat Sep 28 15:22:26 2024 +0200 drop 1004_pypy3.patch (applied upstream) commit 0cf461941688469448ae2268ac74b311cf7437af Merge: ace4c6c6 30a144f9 Author: Alexandre Rossi <alexandre.rossi@gmail.com> Date: Sat Sep 28 15:20:16 2024 +0200 Update upstream source from tag 'upstream/2.0.27' Update to upstream version '2.0.27' with Debian dir 28f878faa654a72d307dd8879cdc536682b0f1b9 commit 30a144f97977b7efd0573ccbe0ea27ae560afc49 Merge: d23fcbee a0481fe2 Author: Alexandre Rossi <alexandre.rossi@gmail.com> Date: Sat Sep 28 15:20:13 2024 +0200 New upstream version 2.0.27 commit ace4c6c63c0fcafa4c00ecf0d1579c39b94305a8 Author: Alexandre Rossi <alexandre.rossi@gmail.com> Date: Sat Sep 28 15:17:06 2024 +0200 remove obsolete README.source commit a0481fe2d2f95d10f37b570df92835a7d649f7e4 Author: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> Date: Mon Sep 23 22:05:33 2024 +0200 Add Python 3.13 to trove classifiers commit 2b0b802678441fe3910d052255ba5dd40c1ad234 Author: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> Date: Mon Sep 23 22:04:53 2024 +0200 Bump to 2.0.27 for real commit 697541c7b9c12b4978e7c9cf1785018e98336a75 Author: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> Date: Mon Sep 23 21:29:09 2024 +0200 Bump version to 2.0.27 commit 64502f62d1685ba8d38e39add6b54847f245fa90 Merge: 578dfcab d6f2e89d Author: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> Date: Sun Sep 15 11:21:36 2024 +0200 Merge pull request #2678 from xrmx/backports-2027 Backports for 2.0.27 commit d6f2e89d436925c40d538afc3442d6263fd65501 Author: Alexandre Rossi <alexandre.rossi@gmail.com> Date: Thu Aug 29 08:45:24 2024 +0200 port pypy plugin to python3 [xrmx: add 36e045c4f7b58f4e46c73bec65b69fd09a07d38e to reduce delta with master] commit 86f2499a3e18bc347af4f8f208f5b720540292a3 Author: Alexandre Rossi <alexandre.rossi@gmail.com> Date: Mon Sep 9 12:02:58 2024 +0200 integration tests: add basic test for php, python and pypy plugins commit c5e6ce2ac5543884f01acdec1b2e519c47985121 Author: Alexandre Rossi <alexandre.rossi@gmail.com> Date: Tue May 28 17:49:44 2024 +0200 tests: use UWSGI_PLUGINS env var to define plugins tests commit 555304d5cefa5c2651c6c1649d5222a7cb14aed5 Author: Alexandre Rossi <alexandre.rossi@gmail.com> Date: Tue May 28 17:48:43 2024 +0200 tests: allow log output only if test fails commit dbeeaf8151c40bd3842da241c14d68f95b7130ed Author: Ralf Ertzinger <ralf@skytale.net> Date: Sun Sep 8 20:34:01 2024 +0200 Minor rework of Python 3.13 support As mentioned in https://github.com/unbit/uwsgi/pull/2655, this changes the way support for python 3.13 is handled. Instead of handling python 3.13 as a minor change from 3.12, and handling support for it under the 3.12 `#ifdef` blocks, this breaks out 3.13 into its own block, apart from 3.12. This makes the code a bit more verbose, but makes it easier to see what the structures look like for different python versions. commit 65577d6fac8b8b1e42a922a102dcc9b8d0a7b4f8 Author: Inada Naoki <songofacandy@gmail.com> Date: Mon Jul 8 08:11:52 2024 +0000 gracefully_kill() uses pipe to stop worker loop commit 79fc49eb71270fffc282f1f512ea21582693c96c Author: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> Date: Sun Jul 21 16:13:10 2024 +0200 ci: test on Python 3.13 That is still in beta but removed private C APIs we were using. commit d8ea43bc6fb4b010e19f51f32c59ac9ea301e4ac Author: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> Date: Sun Jul 21 16:32:31 2024 +0200 plugins/python: handle cframe removal from CPython thread state Use current_frame instead commit 1caea16df8d681b66071192b05ada588c3368e28 Author: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> Date: Sun Jul 21 16:00:35 2024 +0200 core/uwsgi: set enable threads by default As it should have been since years :_) commit 92f207cdd916fa19c45bff164110414baef4a2f1 Author: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> Date: Sun Jul 21 15:49:53 2024 +0200 plugins/python: use PyOS_*Fork stable API functions on 3.7+ To avoid calling functions made private from 3.13+. And probably fixing issues with C extensions. commit 0fd9f8b217ab358824efb623776e852634f91fb3 Author: Joe <cuchac@email.cz> Date: Tue Sep 3 08:34:18 2024 +0200 PHP: Add support for uwsgi.disconnect() function This allows to run some code after finishing request. As described in https://symfony.com/doc/current/components/http_kernel.html#8-the-kernel-terminate-event commit 738030d7227353501becb6ade2076958add8e740 Author: John Garland <johnnybg@gmail.com> Date: Wed Feb 3 14:18:17 2016 +1100 Fix --catch-exceptions causing a segfault in Python 3.5. This bug arose due to the fact that the traceback module was overhauled in python 3.5: https://hg.python.org/cpython/rev/73afda5a4e4c The crash was due to PyTuple_GetItem returning NULL as a traceback is no longer a list of tuples but rather a list of objects (which support indexing). commit 8f1d0e5ec807faeba9ec19c223196d77026ff466 Author: 赵浩彬 <zhaohaobin@corp.netease.com> Date: Mon Jul 22 17:25:37 2024 +0800 Fix gracefully_kill_them_all with running requests With the following: ``` wsgi = app:app http = :8000 master = true processes = 2 harakiri = 15 harakiri-verbose = true harakiri-graceful-timeout = 15 harakiri-graceful-signal = 15 max-requests = 100000 memory-report = true enable-threads = true threads = 4 enable-thread = true showconfig = true listen = 1024 post-buffering = 8192 buffer-size = 32768 lazy = true http-keepalive = 1 add-header = Connection: Keep-Alive http-timeout = 70 socket-timeout = 75 hook-master-start = unix_signal:15 gracefully_kill_them_all vacuum = true hook-master-start = unix_signal:15 gracefully_kill_them_all ``` kill -s 15 master-pid while request does not complete. fllowing is uwsgi log: ``` running "unix_signal:15 gracefully_kill_them_all" (master-start)... WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x55de52cb68f0 pid: 143521 (default app) WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x55de52cb68f0 pid: 143520 (default app) graceful shutdown triggered... Gracefully killing worker 1 (pid: 143520)... gateway "uWSGI http 1" has been buried (pid: 143522) Gracefully killing worker 2 (pid: 143521)... worker 1 buried after 1 seconds {address space usage: 277147648 bytes/264MB} {rss usage: 34459648 bytes/32MB} [pid: 143521|app: 0|req: 1/1] 127.0.0.1 () {28 vars in 291 bytes } [Mon Jul 22 09:13:34 2024] GET / => generated 11 bytes in 6036 msecs (HTTP/1.1 200) 3 headers in 103 bytes (1 switches on core 0) worker 2 buried after 4 seconds goodbye to uWSGI. ``` The gateway process(pid=143522) is closed prematurely, causing the client to be unable to correctly receive the request result. I think you should wait for the worker process to shut down before shutting down the gateway process Fix #2656 commit 720631820739565cb028b6c8761b7f1572bfa472 Author: Anthony Sottile <asottile@umich.edu> Date: Sun Sep 8 15:53:38 2024 +0200 pyuwsgi: avoid interleaving pywsgi threadstate In all versions of pyuwsgi at the moment the first fork has a NULL threadstate due to uwsgi_python_master_fixup which calls UWSGI_RELEASE_GIL (expanded to PyEval_SaveThread -- which drops the GIL and sets threadstate to NULL). This is called during uwsgi_setup. After uwsgi_setup was returning, PyThreadState_Swap was restoring the pyuwsgi threadstate (in both the original and worker processes) Future forks would have the pyuwsgi threadstate active (from the restoration at PyThreadState_Swap) in python versions < 3.12 this wasn't an issue. In 3.12+ the PyEval_RestoreThread would attempt to take_gil and then block forever on the GIL mutex (despite it actually holding it? due to the fork state from the parent process). Bisecting cpython showed that python/cpython@92d8bff slightly changed behaviour of PyThreadState_Swap (it now additionally manages GIL state: unlocking the previous threadstate and locking the new threadstate). Putting a log line in the PyThreadState_Swap showed a suspicious swapping from oldts=123123 to newts=123123 (swapping from its own threadstate to itself?); this is because after forking control would be given back to the original threadstate (which mostly worked but was in UB territory given the GIL state). In 3.11 the threadstate that was restored after the PyThreadState_Swap did not have the GIL locked (technically this could have allowed a data race if threads existed before starting uwsgi via pyuwsgi). In 3.12 since PyThreadState_Swap was changed to release the old threadstate's GIL and acquire the GIL in the new threadstate this meant that the saved threadstate had ->locked = 1 (which is sort of an invalid state?). As far as I can tell there aren't any public apis to undo this and "restore" the 3.11 behaviour precisely. Then later it would try and lock (despite already being -> locked = 1) and deadlock against itself this is actually called out on the docs: If the lock has been created, the current thread must not have acquired it, otherwise deadlock ensues. To fix this once we call uwsgi_setup we never give control back to the original pyuwsgi threadstate avoiding the Swap dance entirely.
Among the 11 debian patches available in version 2.0.26-4 of the package, we noticed the following issues: