Opened 8 years ago

Last modified 8 years ago

#6751 defect new

— at twisted.web._newclient.Response leaves its transport in an unpredictable state depending on how large the response body isVersion 2

Reported by: Glyph Owned by:
Priority: high Milestone:
Component: web Keywords:
Cc: jknight Branch:

Description (last modified by Glyph)

If an HTTP response has a small response-body, and a Twisted application does not immediately call deliverBody when said response is received, Response can leave its transport paused.

Among other things, this means that when HTTP11ClientProtocol.quiescentCallback is invoked, the 'quiescent' connection might be reading (if it happened to go through _deliverBody_INITIAL) or it might be paused (if it happened to go through _deliverBody_DEFERRED_CLOSE).

This will lead to two negative effects:

  1. twisted.web.client.HTTPConnectionPool will end up adding paused connections to its persistent connection cache, and
  2. if something manages to be holding on to the transport, it'll silently hang around forever, leaking an FD; if nothing is holding on to it, it'll be GC'd, closing its socket (without calling connectionLost) some time later.

Change History (2)

comment:1 Changed 8 years ago by DefaultCC Plugin

Cc: jknight added

comment:2 Changed 8 years ago by Glyph

Description: modified (diff)
Note: See TracTickets for help on using tickets.