title: Channels websocket AsyncJsonWebsocketConsumer disconnect not reached
body: <p>I have the following consumer:</p>
  
  <pre><code>class ChatConsumer(AsyncJsonWebsocketConsumer):
      pusher = None
  
      async def connect(self):
          print(self.scope)
          ip = self.scope['client'][0]
          print(ip)
          self.pusher = await self.get_pusher(ip)
          print(self.pusher)
          await self.accept()
  
      async def disconnect(self, event):
          print("closed connection")
          print("Close code = ", event)
          await self.close()
          raise StopConsumer
  
      async def receive_json(self, content):
          #print(content)
          if 'categoryfunctionname' in content:
              await cellvoltage(self.pusher, content)
          else:
              print("ERROR: Wrong data packets send")
              print(content)
  
  
      @database_sync_to_async
      def get_pusher(self, ip):
          p = Pusher.objects.get(auto_id=1)
          try:
              p = Pusher.objects.get(ip=ip)
          except ObjectDoesNotExist:
              print("no pusher found")
          finally:
              return p
  </code></pre>
  
  <p>Connecting, receiving and even getting stuff async from the database works perfectly. Only disconnecting does not work as expected. The following Terminal Log explains what's going on:</p>
  
  <pre><code>2018-09-19 07:09:56,653 - INFO - server - HTTP/2 support not enabled (install the http2 and tls Twisted extras)
  2018-09-19 07:09:56,653 - INFO - server - Configuring endpoint tcp:port=1111:interface=192.168.1.111
  2018-09-19 07:09:56,653 - INFO - server - Listening on TCP address 192.168.1.111:1111
  [2018/09/19 07:11:25] HTTP GET / 302 [0.02, 10.171.253.112:35236]
  [2018/09/19 07:11:25] HTTP GET /login/?next=/ 200 [0.05, 10.111.253.112:35236]
  {'type': 'websocket', 'path': '/ws/chat/RP1/', 'headers': [(b'upgrade', b'websocket'), (b'connection', b'Upgrade'), (b'host', b'10.111.111.112:1111'), (b'origin', b'http://10.111.253.112:1111'), (b'sec-websocket-key', b'vKFAnqaRMm84AGUCxbAm3g=='), (b'sec-websocket-version', b'13')], 'query_string': b'', 'client': ['10.111.253.112', 35238], 'server': ['192.168.1.111', 1111], 'subprotocols': [], 'cookies': {}, 'session': &lt;django.utils.functional.LazyObject object at 0x7fe4a8d1ba20&gt;, 'user': &lt;django.utils.functional.LazyObject object at 0x7fe4a8d1b9e8&gt;, 'path_remaining': '', 'url_route': {'args': (), 'kwargs': {'room_name': 'RP1'}}}
  10.111.253.112
  [2018/09/19 07:11:25] WebSocket HANDSHAKING /ws/chat/RP1/ [10.111.253.112:35238]
  [2018/09/19 07:11:25] WebSocket CONNECT /ws/chat/RP1/ [10.111.111.112:35238]
  no pusher found
  1 - DEFAULT - 0.0.0.0
  ERROR: Wrong data packets send
  {'hello': 'Did I achieve my objective?'}
  [2018/09/19 07:11:46] WebSocket DISCONNECT /ws/chat/RP1/ [10.111.253.112:35238]
  2018-09-19 07:11:56,792 - WARNING - server - Application instance &lt;Task pending coro=&lt;SessionMiddlewareInstance.__call__() running at /home/pi/PycharmProjects/LOGGER/venv/lib/python3.6/site-packages/channels/sessions.py:175&gt; wait_for=&lt;Future pending cb=[_chain_future.&lt;locals&gt;._call_check_cancel() at /usr/lib/python3.6/asyncio/futures.py:403, &lt;TaskWakeupMethWrapper object at 0x7fe4a82e6fd8&gt;()]&gt;&gt; for connection &lt;WebSocketProtocol client=['10.171.253.112', 35238] path=b'/ws/chat/RP1/'&gt; took too long to shut down and was killed.
  </code></pre>
  
  <p>After the 10 seconds timeout it gives a warning that the connection was killed:</p>
  
  <blockquote>
    <p>WARNING - server - Application instance taskname running at location
    at linenumber for connection cxn-name took too long to shut down and
    was killed.</p>
  </blockquote>
  
  <p>The disconnect method was thus also not reached.</p>
  
  <ul>
  <li>What could this be?</li>
  <li>Am I using the correct method?</li>
  <li>Could I expand the timeout period?</li>
  </ul>