If the WSGI task blows up, allow the sender task to shut down
@@ -90,7 +90,9 @@ class WSGIResponder:
self.executor, self.wsgi, environ, self.start_response
)
sender = self.loop.create_task(self.sender(send))
+ try:
await asyncio.wait_for(wsgi, None)
+ finally:
self.send_queue.append(None)
self.send_event.set()
await asyncio.wait_for(sender, None)
