IBodyProducer isn't supported with twisted wsgi stacks

Bug #873030 reported by Robert Collins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-oops-twisted
Fix Released
High
Robert Collins

Bug Description

U1, which would like to use oops-wsgi in a twisted wsgi stack, have an extension where they can return an IBodyProducer rather than a generator, which gets put back into the event loop rather than tying up a thread. That is interfered with by the OOPS middleware as it currently stands.

Related branches

Revision history for this message
Robert Collins (lifeless) wrote :

This is I think the needed contract:
 - app() returns something
 - headers may or may not have been sent
 - that thing is direct-iterable or async iterable via IBodyProducer
 - we want to run some oops-wsgi code when:
  - first bytes are gotten (unbuffer headers, timeout based oopses)
  - end of stream (unbuffer headers)
  - an exception is raised (but not in the gateway code)
    - if nothing has been sent this will want to inject/return data.

So we need a parameterisable wrapper for the result from app()
And a small number of callbacks (3) which the wrapper needs to reliably call
I will start by refactoring oops-wsgi itself to have the needed extension point and this structure internally. Then will write an IBodyProducer wrapper. Then we see how badly I messed it up:)

Revision history for this message
Robert Collins (lifeless) wrote :

oops-wsgi 0.0.6 should be hookable enough.

Changed in python-oops-twisted:
assignee: nobody → Robert Collins (lifeless)
Changed in python-oops-twisted:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.