diff options
author | Max Romanov <max.romanov@nginx.com> | 2021-07-20 10:37:54 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2021-07-20 10:37:54 +0300 |
commit | f27fbd9b4d2bdaddf1e7001d0d0bc5586ba04cd4 (patch) | |
tree | 1d1156008cfc59e14d643a3d66f83b56b7e35a7e /src/python/nxt_python.h | |
parent | dfbdc1c11a201e46d61f4bc61cfbe5741fc4fd70 (diff) | |
download | unit-f27fbd9b4d2bdaddf1e7001d0d0bc5586ba04cd4.tar.gz unit-f27fbd9b4d2bdaddf1e7001d0d0bc5586ba04cd4.tar.bz2 |
Python: using default event_loop for main thread for ASGI.
Unit's ASGI implementation creates a new event loop to run an application for
each thread since 542b5b8c0647. This may cause unexpected exceptions or
strange bugs if asyncio synchronisation primitives are initialised before the
application starts (e.g. globally).
Although the approach with a new event loop for the main thread is consistent
and helps to prepare the application to run in multiple threads, it can be a
source of pain for people who just want to run single-threaded ASGI
applications in Unit.
This is related to #560 issue on GitHub.
Diffstat (limited to '')
-rw-r--r-- | src/python/nxt_python.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/python/nxt_python.h b/src/python/nxt_python.h index a5c1d9a6..e4eac9dc 100644 --- a/src/python/nxt_python.h +++ b/src/python/nxt_python.h @@ -60,7 +60,7 @@ typedef struct { typedef struct { - int (*ctx_data_alloc)(void **pdata); + int (*ctx_data_alloc)(void **pdata, int main); void (*ctx_data_free)(void *data); int (*startup)(void *data); int (*run)(nxt_unit_ctx_t *ctx); |