I am using apache(2.4.6) with mod_wsgi(4.6.5) in daemon mode. I am currently working on a project which needs to preload the WSGI application.
This is the configuration i was using before:
<VirtualHost *:8080>This is the repro.py file:
import osAccording to the following two resources:
I changed the configuration to this:
<VirtualHost *:8080>i.e specified both application-group and process-group directive. This solved the pre-loading problem for us.
But, the difference here is that in the first case all the requests were being handled by the main thread but after the configuration change, the requests are now being handled in the non-main thread. We have a bunch of code that requires things to be run on the main thread and were running previously but after the change, it is causing them to fail.
I tried reordering WSGIApplicationGroup and WSGIProcess group directive but that didn't work. The only thing that worked was the removal of application-group from WSGIScriptAlias but that then would not preload the wsgi app. Could you please suggest to me what other things I could try?
Thank you for your time!
--
You received this message because you are subscribed to the Google Groups "modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modwsgi+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/eb747f16-10b2-48c3-9ce3-2da6a3ef383fn%40googlegroups.com.
On 12 May 2021, at 1:35 am, Swapnil Ojha <swapni...@gmail.com> wrote:Thank you for taking a look and the detailed explanation.> So the question now is what are you doing that has to be done in the main thread and can't be in a secondary thread? If can understand that can explain what you need to do to change your code to handle that requests always run in secondary> threads.
This is part of the non-public code. It modifies the current context and only allows to do so if being done from the main thread.
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/9cbf2cb7-9592-4fc4-9b8e-4a81f934fc06n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/373b764c-0b53-4039-848d-020d08f32d56n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/5be34c29-ad70-40ef-a4ff-ac434b40792en%40googlegroups.com.