-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send + Sync Issues with list_containers #159
Comments
Seemed to be related to passing the Serializer between threads
Did some digging around using a project I'm working on that uses Rocket. Seems like Serializer in this instance is not thread safe, need to wrap the param prep in a closure and return a thread safe string. Will figure out how to make a test for this and add it to my fork before opening a PR |
Thank you for reporting the issue. To help us better understand and resolve the problem, could you please provide a minimal, complete, and verifiable example of the code that reproduces the bug? |
@DrWalrus1 If we cannot actually see the problem here, we cannot confirm the fix and therefore cannot incorporate the fix. |
@eldesh have coded up a small (broken) example here https://github.com/DrWalrus1/dockworker-fix-example. This is how I ran into the problem. |
I have been using numerous dockworker methods inside my tokio / warp server, however one particular method never compiles under a tokio context, and that is ::list_containers
Spent quite a many, many hours trying to figure this out, but the error is:
"
dyn for<'a> Fn(&'a str) -> Cow<'_, [u8]>
cannot be shared between threads safelythe trait
Sync
is not implemented fordyn for<'a> Fn(&'a str) -> Cow<'_, [u8]>
, which is required byimpl Future<Output = Result<impl Reply, Infallible>>: Send
" - for whenever this function is in the mix.I've checked the dockworker code, and there's nothing specifically different here that's obviously problematic, however, the only different struct at play is ContainerFilters - but I can't see anything in there that would make Reply + Send incompatible.
Anyone else used dockworker inside a tokio context with no problems? I've exhausted all my investigations thus far...
The text was updated successfully, but these errors were encountered: