Replies: 1 comment 1 reply
-
There is some information here #3103 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I encountered something unusual while working with
litestar~=2.9.0
. I’m not ready to report it as a bug just yet, but I do have a question regarding the implementation.Specifically, I noticed that there’s a deep copy operation at line 311 in litestar/router.py (permalink to current main branch, not different from 2.9.0). It seems that all
Router
objects are being cloned before use in Litestar.From git blame I've found the commit e15b93d to introuce the deepcopy.
This stood out to me because it’s not something I would typically expect, and there's no accompanying comment in the code to explain its purpose. It also appears to be a likely cause of an issue I’m experiencing in a particular use case—though I’m still in the process of analyzing this.
Could you provide some insight into the reasoning behind this deep copy?
My specific use case involves usage of
a2wsgi
and itsWSGIMiddleware
to allow me adapting a WSGI app to ASGI and mount it as app inside a litestar router (as suggested in #707).WSGIMiddleware
uses a thread pool that includes a queue that eventually cannot be pickled (TypeError: cannot pickle '_queue.SimpleQueue' object
) leading to uncaught exception at line 311 where the deepcopy is performed.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions