If you tried:

    WSGIApplicationGroup %{GLOBAL}

as mentioned in the documentation, then next try:

    
https://modwsgi.readthedocs.io/en/master/user-guides/debugging-techniques.html#extracting-python-stack-traces
 
<https://modwsgi.readthedocs.io/en/master/user-guides/debugging-techniques.html#extracting-python-stack-traces>

to get out stack traces as to where it is getting stuck.

Note you will need to update the code example in that doc to work with Python 3 
as appears to still be for Python 2.

Graham

> On 19 Oct 2020, at 10:08 pm, Manosh Padannayil <[email protected]> 
> wrote:
> 
> Hi Graham,
>     Thanks for the reply. I tried different options as mentioned in the 
> reply. Tried different versions of Python and http, but no luck.
> Actually, I compiled, httpd and python source code and installed the python 
> package mod_wsgi. 
> 
> Below are the detailed steps I did;
> In a fresh VM: Oracle Linux 7.8
> 1.  yum upgrade
>       yum update
>       yun install openssl-devel
>       yun install libffi-devel
> 
> 2. Compiled the following latest packages with prefix as  
> --prefix=/path/to/apache/home
>       pcre2-10.35
>       expat-2.2.10
>       apr-1.6.5
>       apr-util-1.6.1
>       httpd-4.4.46 : compiled with --enable-ssl --enable-so
> 
> 3. Compiled python-3.9.0 with prefix as --prefix=/path/to/python/install/home
> 
> 4. Install python packages: all latest versions:
>       python3 -m pip install grpcio grpcio-tools protobuf mod-wsgi DJango
> 
> 4. Configured /path/to/apache/home/conf/httpd.conf as below
>     
>     Listen 9000
>     User my_username
>     Group my_group
>     ServerName localhost:9000
>       <Directory "/">
>       Require all granted
>       </Directory>
>       WSGIPythonHome /path/to/python/install/home
>       LoadModule wsgi_module 
> /path/to/python/install/home/lib/python3.9/site-packages/mod_wsgi/server/mod_wsgi-py39-cpython-39-x86_64-linux-gnu.so
> 
> Started the apache as /path/to/apache/home/bin/apachectl start
> 
> Below are the logs obtained.
> 
> If I understood correctly from last reply, the python subinterpreter is 
> loaded instead of primary interpreter when a GRPC api is invoked, causing the 
> deadlock.
> 
> Please let me know how to get rid of this deadlock issue with grpc client in 
> mod_wsgi.
> 
> Thanks and Regards,
> Manosh Padannayil
> 
> 
> On Thursday, October 15, 2020 at 2:11:09 AM UTC+5:30 Graham Dumpleton wrote:
> Are you forcing the use of the main Python interpreter?
> 
> https://modwsgi.readthedocs.io/en/master/user-guides/application-issues.html#python-simplified-gil-state-api
>  
> <https://modwsgi.readthedocs.io/en/master/user-guides/application-issues.html#python-simplified-gil-state-api>
> 
> Likely their Python wrapper module isn't designed to work in Python sub 
> interpreters.
> 
> Also, are you using system Apache or mod_wsgi-express? Your configuration 
> list is confusing since you mention multiple Apache versions as well as pip 
> installed mod_wsgi and mod_wsgi-httpd packages.
> 
> If you are using system Apache, you should not have mod_wsgi-httpd package 
> installed and doing so could screw things up if trying to use mod_wsgi 
> install against it with system Apache.
> 
> Finally, are you using system Python packages, or Python from Python Software 
> Foundation. You cannot use Anaconda Python if you want to be able to use SSL 
> in Apache and Python.
> 
> Graham
> 
> 
>> On 14 Oct 2020, at 10:23 pm, Manosh Padannayil <[email protected] 
>> <applewebdata://3E84E550-C42D-4F6F-99E2-90D4A57C38BD>> wrote:
>> 
> 
>> Hello All,
>>    I am getting the exact same issue reported in the below thread but for 
>> Oracle Linux OS.
>> https://github.com/grpc/grpc/issues/13050 
>> <https://github.com/grpc/grpc/issues/13050>
>> 
>> Issue: Python Grpc client service method does not return when called from 
>> httpd on Oracle Linux. It works from eclipse in OSX. Works from python 
>> terminal in Oracle Linux, fails only when it is called from within httpd in 
>> Oracle Linux.
>> 
>> Configuration
>> Oracle Linux 7.8
>> httpd-2.4.41, 2.4.46
>> Python 3.8.0, 3.9.0
>>   Django 2.2.6
>>   grpcio 1.32.0
>>   grpcio-tools 1.32.0
>>   mod-wsgi 4.7.1
>>   mod-wsgi-httpd 2.4.41.1
>> 
>> Pseudo code:
>> from my.service import my_service_pb2_grpc
>> with open('/path/to/pem/file', 'rb') as f:
>>   trusted_certs = f.read()
>> with open('path/to/key/file', 'rb') as f:
>>   cert_key = f.read()
>> cred = grpc.ssl_channel_credentials(root_certificate=trusted_certs, 
>> private_key=cert_key, certificate_chain=trusted_certs)
>> channel = grpc.secure_channel('{}:{}'.format('server_url',443), cred)
>> stub = my_service_pb2_grpc.MyServiceStub(channel)
>> response = stub.MyMethod(MyRequest)
>> 
>> I tried with options grpc.keepalive_timeout_ms and   grpc.keepalive_time as 
>> 10000, but no luck.
>> 
>> Could anyone please help me on this?
>> 
>> Thanks and Regards,
>> Manosh Padannayil
>> 
> 
>> -- 
>> 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 [email protected] 
>> <applewebdata://3E84E550-C42D-4F6F-99E2-90D4A57C38BD>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/modwsgi/d50c82c4-0f9a-4d22-9c30-affac1877e3en%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/modwsgi/d50c82c4-0f9a-4d22-9c30-affac1877e3en%40googlegroups.com?utm_medium=email&utm_source=footer>.
> 
> 
> -- 
> 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 [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/modwsgi/d1d12f74-7e84-400b-af5d-31d2696f42d5n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/modwsgi/d1d12f74-7e84-400b-af5d-31d2696f42d5n%40googlegroups.com?utm_medium=email&utm_source=footer>.
> <IMG_3963.jpg>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/modwsgi/2FFD7BA3-F22A-4903-ACC1-B74F1303E477%40gmail.com.

Reply via email to