From juraj at lutter.sk Mon Dec 7 22:59:12 2020 From: juraj at lutter.sk (Juraj Lutter) Date: Mon, 7 Dec 2020 23:59:12 +0100 Subject: change of polling engine Message-ID: Hi, I am debugging a situation on SmartOS (with unit 1.21.0) where after reconfiguration, the controller socket just blocks indefinitely (the listener is created, however), but curl just won?t return to calling shell. Is there any way to specify which event engine should be used at run time? It is not clear to me from the documentation. Any help/advices appreciated :-) Thanks otis ? Juraj Lutter XMPP: juraj (at) lutter.sk GSM: +421907986576 From igor at sysoev.ru Tue Dec 8 06:11:47 2020 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 8 Dec 2020 09:11:47 +0300 Subject: change of polling engine In-Reply-To: References: Message-ID: <1CE4B98A-4291-4FCF-AE28-5537B28664A0@sysoev.ru> > On 8 Dec 2020, at 01:59, Juraj Lutter wrote: > > Hi, > > I am debugging a situation on SmartOS (with unit 1.21.0) where > after reconfiguration, the controller socket just blocks > indefinitely (the listener is created, however), but > curl just won?t return to calling shell. > > Is there any way to specify which event engine should be used at run time? > > It is not clear to me from the documentation. > > Any help/advices appreciated :-) Could you share these output of ./configure: checking for Linux epoll ... not found checking for kqueue ... found checking for kqueue EVFILT_USER ... found checking for Solaris event port ... not found checking for /dev/poll ... not found checking for AIX pollset ... not found -- Igor Sysoev From juraj at lutter.sk Tue Dec 8 10:29:32 2020 From: juraj at lutter.sk (Juraj Lutter) Date: Tue, 8 Dec 2020 11:29:32 +0100 Subject: change of polling engine In-Reply-To: <1CE4B98A-4291-4FCF-AE28-5537B28664A0@sysoev.ru> References: <1CE4B98A-4291-4FCF-AE28-5537B28664A0@sysoev.ru> Message-ID: <4DA11DA0-EC0D-42DC-8798-ED17AB4556BA@lutter.sk> Hi, on illumos, epoll() is found but is not working as expected (somewhere in the code, there is timeout -1 that is causing it to wait). I?ve patched auto/events to not use epoll on illumos, leaving eventports in use, and now it work as expected. I also have some other patches in place, see: https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=tree;f=unit/patches;h=8cd8485225809826953a79f9cc1c35d27e64622e;hb=HEAD We are working on it with Sergey Osokin. otis ? Juraj Lutter XMPP: juraj (at) lutter.sk GSM: +421907986576 > On 8 Dec 2020, at 07:11, Igor Sysoev wrote: > >> On 8 Dec 2020, at 01:59, Juraj Lutter wrote: >> >> Hi, >> >> I am debugging a situation on SmartOS (with unit 1.21.0) where >> after reconfiguration, the controller socket just blocks >> indefinitely (the listener is created, however), but >> curl just won?t return to calling shell. >> >> Is there any way to specify which event engine should be used at run time? >> >> It is not clear to me from the documentation. >> >> Any help/advices appreciated :-) > > Could you share these output of ./configure: > > checking for Linux epoll ... not found > checking for kqueue ... found > checking for kqueue EVFILT_USER ... found > checking for Solaris event port ... not found > checking for /dev/poll ... not found > checking for AIX pollset ... not found > From tarkhil at over.ru Tue Dec 8 12:26:19 2020 From: tarkhil at over.ru (=?UTF-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCf0L7QstC+0LvQvtGG0LrQuNC5?=) Date: Tue, 8 Dec 2020 15:26:19 +0300 Subject: How do I get remote IP from ngnix? Message-ID: <20641ec0-8be4-0f57-d698-9d961fa2dafb@over.ru> Hello My application running under nginx+unitd receives address of nginx as remote IP. Should I honor X-Real-IP in my app or there is some way to extract real client IP transparently? -- Alex -- ??? ????????? ????????? ?? ?????? ??????????? Avast. https://www.avast.com/antivirus From vbart at nginx.com Tue Dec 8 18:34:20 2020 From: vbart at nginx.com (Valentin V. Bartenev) Date: Tue, 08 Dec 2020 21:34:20 +0300 Subject: How do I get remote IP from ngnix? In-Reply-To: <20641ec0-8be4-0f57-d698-9d961fa2dafb@over.ru> References: <20641ec0-8be4-0f57-d698-9d961fa2dafb@over.ru> Message-ID: <1776406.CQOukoFCf9@vbart-laptop> On Tuesday, 8 December 2020 15:26:19 MSK ????????? ?????????? wrote: > Hello > > My application running under nginx+unitd receives address of nginx as > remote IP. > > Should I honor X-Real-IP in my app or there is some way to extract real > client IP transparently? > [..] Unfortunately, handling it in the application is the only way right now. But we have in our plans something similar to the realip module from nginx. wbr, Valentin V. Bartenev From aunghsi3323.ak at gmail.com Tue Dec 8 19:43:43 2020 From: aunghsi3323.ak at gmail.com (Aung Hsi) Date: Wed, 9 Dec 2020 02:13:43 +0630 Subject: what "nxt_port_s" means Message-ID: aunghsi3323.ak at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From tarkhil at over.ru Tue Dec 8 19:51:26 2020 From: tarkhil at over.ru (=?UTF-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCf0L7QstC+0LvQvtGG0LrQuNC5?=) Date: Tue, 8 Dec 2020 22:51:26 +0300 Subject: How do I get remote IP from ngnix? In-Reply-To: <1776406.CQOukoFCf9@vbart-laptop> References: <20641ec0-8be4-0f57-d698-9d961fa2dafb@over.ru> <1776406.CQOukoFCf9@vbart-laptop> Message-ID: Just got it by grepping sources ;) Ok, I'm writing my app, not using it, so that's not a big problem, just one command and two lines of code. On 08.12.2020 21:34, Valentin V. Bartenev wrote: > On Tuesday, 8 December 2020 15:26:19 MSK ????????? ?????????? wrote: >> Hello >> >> My application running under nginx+unitd receives address of nginx as >> remote IP. >> >> Should I honor X-Real-IP in my app or there is some way to extract real >> client IP transparently? >> > [..] > > Unfortunately, handling it in the application is the only way right now. > But we have in our plans something similar to the realip module from nginx. > > wbr, Valentin V. Bartenev > > > > _______________________________________________ > unit mailing list > unit at nginx.org > https://mailman.nginx.org/mailman/listinfo/unit -- ??? ????????? ????????? ?? ?????? ??????????? Avast. https://www.avast.com/antivirus From juraj at lutter.sk Wed Dec 9 10:05:40 2020 From: juraj at lutter.sk (Juraj Lutter) Date: Wed, 9 Dec 2020 11:05:40 +0100 Subject: change of polling engine In-Reply-To: <4DA11DA0-EC0D-42DC-8798-ED17AB4556BA@lutter.sk> References: <1CE4B98A-4291-4FCF-AE28-5537B28664A0@sysoev.ru> <4DA11DA0-EC0D-42DC-8798-ED17AB4556BA@lutter.sk> Message-ID: Hi, FWIW, configure called with ?cc-opt="-DNXT_HAVE_EPOLL_EDGE=0 -DNXT_HAVE_EPOLL=0 -DNXT_HAVE_EVENTPORT=1" gives: checking for Linux epoll ... found checking for Linux signalfd() ... found checking for Linux eventfd() ... found checking for kqueue ... not found checking for Solaris event port ... found checking for /dev/poll ? found thus, epoll is still being used and now even build fails: src/nxt_epoll_engine.c: In function 'nxt_epoll_create': src/nxt_epoll_engine.c:237:15: error: 'union ' has no member named 'epoll'; did you mean 'poll'? engine->u.epoll.fd = -1; ^~~~~ poll src/nxt_epoll_engine.c:238:15: error: 'union ' has no member named 'epoll'; did you mean 'poll'? engine->u.epoll.mode = mode; ^~~~~ poll Thanks otis ? Juraj Lutter XMPP: juraj (at) lutter.sk GSM: +421907986576 > On 8 Dec 2020, at 11:29, Juraj Lutter wrote: > > Hi, > > on illumos, epoll() is found but is not working as > expected (somewhere in the code, there is timeout -1 > that is causing it to wait). > > I?ve patched auto/events to not use epoll on illumos, > leaving eventports in use, and now it work as expected. > > > I also have some other patches in place, see: > https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=tree;f=unit/patches;h=8cd8485225809826953a79f9cc1c35d27e64622e;hb=HEAD > > We are working on it with Sergey Osokin. > > otis > > ? > Juraj Lutter > XMPP: juraj (at) lutter.sk > GSM: +421907986576 > >> On 8 Dec 2020, at 07:11, Igor Sysoev wrote: >> >>> On 8 Dec 2020, at 01:59, Juraj Lutter wrote: >>> >>> Hi, >>> >>> I am debugging a situation on SmartOS (with unit 1.21.0) where >>> after reconfiguration, the controller socket just blocks >>> indefinitely (the listener is created, however), but >>> curl just won?t return to calling shell. >>> >>> Is there any way to specify which event engine should be used at run time? >>> >>> It is not clear to me from the documentation. >>> >>> Any help/advices appreciated :-) >> >> Could you share these output of ./configure: >> >> checking for Linux epoll ... not found >> checking for kqueue ... found >> checking for kqueue EVFILT_USER ... found >> checking for Solaris event port ... not found >> checking for /dev/poll ... not found >> checking for AIX pollset ... not found >> > > _______________________________________________ > unit mailing list > unit at nginx.org > https://mailman.nginx.org/mailman/listinfo/unit From vbart at nginx.com Wed Dec 9 10:46:49 2020 From: vbart at nginx.com (Valentin V. Bartenev) Date: Wed, 09 Dec 2020 13:46:49 +0300 Subject: change of polling engine In-Reply-To: References: <4DA11DA0-EC0D-42DC-8798-ED17AB4556BA@lutter.sk> Message-ID: <2750955.e9J7NaK4W3@vbart-laptop> Hi, I think it would be better to find out what's wrong in case of epoll. Could you share a debug log with the issue? Note, that some time ago we finally dropped Solaris from our testing builds due to constantly increasing burden of maintaining its support. So, I'm not sure that eventport code is still in a good shape and able to function well. Also, the issue can be irrelevant to the event method. wbr, Valentin V. Bartenev On Wednesday, 9 December 2020 13:05:40 MSK Juraj Lutter wrote: > Hi, > > FWIW, configure called with ?cc-opt="-DNXT_HAVE_EPOLL_EDGE=0 -DNXT_HAVE_EPOLL=0 -DNXT_HAVE_EVENTPORT=1" > > gives: > > checking for Linux epoll ... found > checking for Linux signalfd() ... found > checking for Linux eventfd() ... found > checking for kqueue ... not found > checking for Solaris event port ... found > checking for /dev/poll ? found > > thus, epoll is still being used and now even build fails: > > src/nxt_epoll_engine.c: In function 'nxt_epoll_create': > src/nxt_epoll_engine.c:237:15: error: 'union ' has no member named 'epoll'; did you mean 'poll'? > engine->u.epoll.fd = -1; > ^~~~~ > poll > src/nxt_epoll_engine.c:238:15: error: 'union ' has no member named 'epoll'; did you mean 'poll'? > engine->u.epoll.mode = mode; > ^~~~~ > poll > > Thanks > > otis > > ? > Juraj Lutter > XMPP: juraj (at) lutter.sk > GSM: +421907986576 > > > On 8 Dec 2020, at 11:29, Juraj Lutter wrote: > > > > Hi, > > > > on illumos, epoll() is found but is not working as > > expected (somewhere in the code, there is timeout -1 > > that is causing it to wait). > > > > I?ve patched auto/events to not use epoll on illumos, > > leaving eventports in use, and now it work as expected. > > > > > > I also have some other patches in place, see: > > https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=tree;f=unit/patches;h=8cd8485225809826953a79f9cc1c35d27e64622e;hb=HEAD > > > > We are working on it with Sergey Osokin. > > > > otis > > > > ? > > Juraj Lutter > > XMPP: juraj (at) lutter.sk > > GSM: +421907986576 > > > >> On 8 Dec 2020, at 07:11, Igor Sysoev wrote: > >> > >>> On 8 Dec 2020, at 01:59, Juraj Lutter wrote: > >>> > >>> Hi, > >>> > >>> I am debugging a situation on SmartOS (with unit 1.21.0) where > >>> after reconfiguration, the controller socket just blocks > >>> indefinitely (the listener is created, however), but > >>> curl just won?t return to calling shell. > >>> > >>> Is there any way to specify which event engine should be used at run time? > >>> > >>> It is not clear to me from the documentation. > >>> > >>> Any help/advices appreciated :-) > >> > >> Could you share these output of ./configure: > >> > >> checking for Linux epoll ... not found > >> checking for kqueue ... found > >> checking for kqueue EVFILT_USER ... found > >> checking for Solaris event port ... not found > >> checking for /dev/poll ... not found > >> checking for AIX pollset ... not found > >> > > > > _______________________________________________ > > unit mailing list > > unit at nginx.org > > https://mailman.nginx.org/mailman/listinfo/unit > > _______________________________________________ > unit mailing list > unit at nginx.org > https://mailman.nginx.org/mailman/listinfo/unit > From juraj at lutter.sk Wed Dec 9 12:43:05 2020 From: juraj at lutter.sk (Juraj Lutter) Date: Wed, 9 Dec 2020 13:43:05 +0100 Subject: change of polling engine In-Reply-To: <2750955.e9J7NaK4W3@vbart-laptop> References: <4DA11DA0-EC0D-42DC-8798-ED17AB4556BA@lutter.sk> <2750955.e9J7NaK4W3@vbart-laptop> Message-ID: > On 9 Dec 2020, at 11:46, Valentin V. Bartenev wrote: > > Hi, > > I think it would be better to find out what's wrong in case of epoll. > Could you share a debug log with the issue? > Yes, I will. > Note, that some time ago we finally dropped Solaris from our testing builds > due to constantly increasing burden of maintaining its support. So, I'm not > sure that eventport code is still in a good shape and able to function well. > FWIW, illumos based distributions are very popular and wide-spread (OmniOS, OpenIndiana, SmartOS, Tribblix, ?), so I guess it would be a pity to not have unit working. Moreover, if it will run on SmartOS, for example, it could be included in pkgsrc, as we test all packages on SmartOS, NetBSD, Linux, Darwin. > Also, the issue can be irrelevant to the event method. > If you could give me some pointer how to debug this properly, I can do it. Or I can provide an access to SmartOS zone where someone else could do it. Thanks otis From vbart at nginx.com Thu Dec 10 13:38:25 2020 From: vbart at nginx.com (Valentin V. Bartenev) Date: Thu, 10 Dec 2020 16:38:25 +0300 Subject: change of polling engine In-Reply-To: References: <2750955.e9J7NaK4W3@vbart-laptop> Message-ID: <43451925.fMDQidcC6G@vbart-laptop> On Wednesday, 9 December 2020 15:43:05 MSK Juraj Lutter wrote: [..] > > If you could give me some pointer how to debug this properly, I can do it. Or > I can provide an access to SmartOS zone where someone else could do it. > Let's look to the debug log first: https://unit.nginx.org/troubleshooting/#debug-log If it doesn't reveal the root cause of the issue then I may ask you about the access. wbr, Valentin V. Bartenev From tarkhil at over.ru Sat Dec 19 15:48:02 2020 From: tarkhil at over.ru (=?UTF-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCf0L7QstC+0LvQvtGG0LrQuNC5?=) Date: Sat, 19 Dec 2020 18:48:02 +0300 Subject: sane way of cleaning up stale unix sockets? Message-ID: <4aa7a86a-09cb-cb8a-b6dc-16d53bba4f41@over.ru> Hello Sometimes unitd leaves behind orphaned unix sockets (well, just configure it to use some and kill -9!) On next start, unitd fails to start because of existing sockets. Is there a sane way to clean up them on start? keeping separate list of sockets-to-remove is a clear way to insainty. -- Alex From vbart at nginx.com Tue Dec 22 14:12:09 2020 From: vbart at nginx.com (Valentin V. Bartenev) Date: Tue, 22 Dec 2020 17:12:09 +0300 Subject: sane way of cleaning up stale unix sockets? In-Reply-To: <4aa7a86a-09cb-cb8a-b6dc-16d53bba4f41@over.ru> References: <4aa7a86a-09cb-cb8a-b6dc-16d53bba4f41@over.ru> Message-ID: <2005944.KlZ2vcFHjT@vbart-laptop> On Saturday, 19 December 2020 18:48:02 MSK ????????? ?????????? wrote: > Hello > > Sometimes unitd leaves behind orphaned unix sockets (well, just > configure it to use some and kill -9!) > > On next start, unitd fails to start because of existing sockets. > > Is there a sane way to clean up them on start? keeping separate list of > sockets-to-remove is a clear way to insainty. [..] Hello, Indeed, this is a problem. That's the reason why the usage of unix sockets in listeners is still undocumented. It's not so easy to fix, because we need to avoid the situation when the socket is used by some other processes and avoid any possible race conditions here. Actually, until it will be fixed I have no better idea than put them all in the same dedicated directory and just clean up everything in it each restart. wbr, Valentin V. Bartenev From tarkhil at over.ru Tue Dec 22 14:14:15 2020 From: tarkhil at over.ru (=?UTF-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCf0L7QstC+0LvQvtGG0LrQuNC5?=) Date: Tue, 22 Dec 2020 17:14:15 +0300 Subject: sane way of cleaning up stale unix sockets? In-Reply-To: <2005944.KlZ2vcFHjT@vbart-laptop> References: <4aa7a86a-09cb-cb8a-b6dc-16d53bba4f41@over.ru> <2005944.KlZ2vcFHjT@vbart-laptop> Message-ID: <0fcfdacf-4606-ec9a-6c86-8f3c4804070b@over.ru> Maybe just https://gavv.github.io/articles/unix-socket-reuse/ ? On 22.12.2020 17:12, Valentin V. Bartenev wrote: > On Saturday, 19 December 2020 18:48:02 MSK ????????? ?????????? wrote: >> Hello >> >> Sometimes unitd leaves behind orphaned unix sockets (well, just >> configure it to use some and kill -9!) >> >> On next start, unitd fails to start because of existing sockets. >> >> Is there a sane way to clean up them on start? keeping separate list of >> sockets-to-remove is a clear way to insainty. > [..] > > Hello, > > Indeed, this is a problem. That's the reason why the usage of unix sockets > in listeners is still undocumented. > > It's not so easy to fix, because we need to avoid the situation when the socket > is used by some other processes and avoid any possible race conditions > here. > > Actually, until it will be fixed I have no better idea than put them all in the > same dedicated directory and just clean up everything in it each restart. > > wbr, Valentin V. Bartenev > > > > _______________________________________________ > unit mailing list > unit at nginx.org > https://mailman.nginx.org/mailman/listinfo/unit From vbart at nginx.com Tue Dec 22 14:40:36 2020 From: vbart at nginx.com (Valentin V. Bartenev) Date: Tue, 22 Dec 2020 17:40:36 +0300 Subject: sane way of cleaning up stale unix sockets? In-Reply-To: <0fcfdacf-4606-ec9a-6c86-8f3c4804070b@over.ru> References: <4aa7a86a-09cb-cb8a-b6dc-16d53bba4f41@over.ru> <2005944.KlZ2vcFHjT@vbart-laptop> <0fcfdacf-4606-ec9a-6c86-8f3c4804070b@over.ru> Message-ID: <6289051.4vTCxPXJkl@vbart-laptop> Actually we thought about a connection test with the algorithm of atomic creation of such sockets, that was implemented earlier this year for the control socket: https://hg.nginx.org/unit/rev/0a8840921fd0 -- Valentin On Tuesday, 22 December 2020 17:14:15 MSK ????????? ?????????? wrote: > Maybe just https://gavv.github.io/articles/unix-socket-reuse/ ? > > On 22.12.2020 17:12, Valentin V. Bartenev wrote: > > On Saturday, 19 December 2020 18:48:02 MSK ????????? ?????????? wrote: > >> Hello > >> > >> Sometimes unitd leaves behind orphaned unix sockets (well, just > >> configure it to use some and kill -9!) > >> > >> On next start, unitd fails to start because of existing sockets. > >> > >> Is there a sane way to clean up them on start? keeping separate list of > >> sockets-to-remove is a clear way to insainty. > > [..] > > > > Hello, > > > > Indeed, this is a problem. That's the reason why the usage of unix sockets > > in listeners is still undocumented. > > > > It's not so easy to fix, because we need to avoid the situation when the socket > > is used by some other processes and avoid any possible race conditions > > here. > > > > Actually, until it will be fixed I have no better idea than put them all in the > > same dedicated directory and just clean up everything in it each restart. > > > > wbr, Valentin V. Bartenev > > > > > > > > _______________________________________________ > > unit mailing list > > unit at nginx.org > > https://mailman.nginx.org/mailman/listinfo/unit > _______________________________________________ > unit mailing list > unit at nginx.org > https://mailman.nginx.org/mailman/listinfo/unit > From info at botpublishing.com Mon Dec 28 17:04:35 2020 From: info at botpublishing.com (Bot-Publishing Inc.) Date: Mon, 28 Dec 2020 12:04:35 -0500 Subject: asgi 'lifespan.shutdown' Message-ID: Hello, I am trying to determine the best way to introduce a resource clean up logic into a python module that is called using ASGI protocol. I am successfully catching the *'lifespan.startup' *event from within my async def application(scope, receive, send*) *implementation. Unfortunately, I do not see the *'lifespan.shutdown' *event when the process is unloaded. My config file includes: "processes": { "max": 3, "spare": 1, "idle_timeout": 10 }, I was under the assumption that the above config will force the idle processes to shut down resulting in the *'lifespan.shutdown' *event . Would appreciate any assistance. gen -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.romanov at nginx.com Mon Dec 28 17:59:03 2020 From: max.romanov at nginx.com (Max Romanov) Date: Mon, 28 Dec 2020 20:59:03 +0300 Subject: asgi 'lifespan.shutdown' In-Reply-To: References: Message-ID: Hello, Could you please check the unit.log file for message like "Got invalid state transition on lifespan protocol" ? This message means there is an unexpected reaction in response to 'lifespan.startup' event. For instance, you don?t send the 'lifespan.startup.complete' message or return from your application function before reading the 'lifespan.shutdown'. Working example is attached. ? Max > On 28 Dec 2020, at 20:04, Bot-Publishing Inc. wrote: > > Hello, > > I am trying to determine the best way to introduce a resource clean up logic into a python module that is called using ASGI protocol. > > I am successfully catching the 'lifespan.startup' event from within my async def application(scope, receive, send) implementation. > > Unfortunately, I do not see the 'lifespan.shutdown' event when the process is unloaded. > > My config file includes: > "processes": { > "max": 3, > "spare": 1, > "idle_timeout": 10 > }, > > I was under the assumption that the above config will force the idle processes to shut down resulting in the 'lifespan.shutdown' event . > > Would appreciate any assistance. > gen > _______________________________________________ > unit mailing list > unit at nginx.org > https://mailman.nginx.org/mailman/listinfo/unit -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: example_asgi.tgz Type: application/octet-stream Size: 595 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at botpublishing.com Mon Dec 28 19:24:29 2020 From: info at botpublishing.com (Bot-Publishing Inc.) Date: Mon, 28 Dec 2020 14:24:29 -0500 Subject: asgi 'lifespan.shutdown' In-Reply-To: References: Message-ID: Thank you very Max. Your example and suggestion to look into the unit.log helped me to resolve the issue. Gen On Mon, Dec 28, 2020 at 12:59 PM Max Romanov wrote: > Hello, > > Could you please check the unit.log file for message like "Got invalid > state transition on lifespan protocol" ? > This message means there is an unexpected reaction in response to > 'lifespan.startup' event. For instance, you don?t send the > 'lifespan.startup.complete' message or return from your application > function before reading the 'lifespan.shutdown'. > > Working example is attached. > > ? > Max > > > > On 28 Dec 2020, at 20:04, Bot-Publishing Inc. > wrote: > > Hello, > > I am trying to determine the best way to introduce a resource clean up > logic into a python module that is called using ASGI protocol. > > I am successfully catching the *'lifespan.startup' *event from within my > async def application(scope, receive, send*) *implementation. > > Unfortunately, I do not see the *'lifespan.shutdown' *event when the > process is unloaded. > > My config file includes: > "processes": { > "max": 3, > "spare": 1, > "idle_timeout": 10 > }, > > I was under the assumption that the above config will force the idle > processes to shut down resulting in the *'lifespan.shutdown' *event . > > Would appreciate any assistance. > gen > _______________________________________________ > unit mailing list > unit at nginx.org > https://mailman.nginx.org/mailman/listinfo/unit > > > _______________________________________________ > unit mailing list > unit at nginx.org > https://mailman.nginx.org/mailman/listinfo/unit -------------- next part -------------- An HTML attachment was scrubbed... URL: