Do Middleware Stack Traces Bug People?

We’ve all had the “look at a request stacktrace” moment:

At $JOB we have 45 different little middleware running in between our requests. Most of them fit in the “annotate a request”/“annotate a response” category, yet because of the new-style middleware (“new” since 1.10 :smile: ) I’m kinda like… well. I don’t want this in my stack trace!

(EDIT: I realized after posting this that this is, of course, a thing full of things using MiddlewareMixin, making this stack trace less beautiful than if it just, y’know, listed the middleware directly. My apologies)

I was re-reading DEP 0005, and I think the poitn about old-style middlware’s “process request doesn’t mean you’ll see process response” thing is very valid. But! The “dumb-guy confidence” feeling for me on this problem is two-fold:

  • the generator-style middleware is still a minority
  • There’s probably a way to juggle the two styles

Having said that… had a couple questions for the audience:

  • Do people even think the stack trace thing is a problem? I can see the “factually correct” argument for it
  • Do people have an apetite for Yet Another migration format change (even if it was now a couple years back) to solve that problem (if someone showed up with a Perfect Solution)?

I do really like the current simplicity of the middleware model in terms of writing the middleware, but the code flow really bugs me!