title: django, gunicorn, grpc: "Failed to pick subchannel" if run django grpc client with gunicorn
body: <p>I am a beginner in the Django framework. I wrote an application consist of 2 microservices. One as a Django Rest Server and the other as a Django GRPC Server. the rest request translated to GRPC requests in the first server and sent to the second for the process.</p>
  <pre><code>      ------&gt;|-----------|-------&gt;|-----------|
               |rest server|        |grpc server|
               |           |        |           |
        &lt;------|-----------|&lt;-------|-----------|
  </code></pre>
  <p>when I ran the first server with <code>python manage.py runserver ip:port</code> the application works properly. but when I ran the first server with <code>gunicorn myapp.wsgi --workers=1 --bind=ip:port</code>, a grpc request from the rest server randomly counter an error:</p>
  <pre><code>{&quot;created&quot;:&quot;@1593330482.005402565&quot;,&quot;description&quot;:&quot;Failed to pick 
  subchannel&quot;,&quot;file&quot;:&quot;src/core/ext/filters/client_channel/client_channel.cc&quot;,&quot;file_line&quot;:3981,&quot;refer
  enced_errors&quot;:[{&quot;created&quot;:&quot;@1593330482.005396918&quot;,&quot;description&quot;:&quot;failed to connect to all 
  addresses&quot;,&quot;file&quot;:&quot;src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc&quot;,&quot;file_l
  ine&quot;:394,&quot;grpc_status&quot;:14}]}
  </code></pre>
  <p><strong>the interesting thing is the grpc request was received by grpc server and it sent back the response.</strong></p>
  <p>wsgi.py:</p>
  <pre class="lang-py prettyprint-override"><code>import os
  
  from django.core.wsgi import get_wsgi_application
  
  os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myapp.settings')
  
  application = get_wsgi_application()
  </code></pre>