-
Notifications
You must be signed in to change notification settings - Fork 3
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
WIP: add curl share locks to make things threadsafe #18
base: main
Are you sure you want to change the base?
Conversation
Just adding the curl locks don't seem to make things thread safe. The CI environment is actually single threaded, so best to run the tests locally to see what's failing. Multiple tasks run fine though. And in the threaded tests each thread had its own gRPCChannel with it's own Multi instance. That makes it a bit more puzzling. |
I had a quick look through here - it does all seem to make sense in terms of Do we call
Yes this does seem puzzling. LibCurl's own documentation suggests that this should be fine. |
I see |
Looks like JuliaLang/Downloads.jl#151 should (?) have fixed some of the immediate upstream issues. |
Awesome! Seems to work fine with JuliaLang/Downloads.jl#151 🎉 👍 |
58b6e93
to
7b07bab
Compare
Was able to test gRPCClient on Julia 1.5 and Downloads master quite a bit. Tests pass when I use a per thread Downloader, which having a separate client instance per thread achieves. But segfaults at different locations with shared downloader. |
I think that's the nature of curl. In their documentation they have written that a connection can't used by different threads. One downloader at one task at a time IIRC. I will try to puzzle the things together for the TypeDBClient and will report how it works. |
It could be the libcurl bug mentioned here: JuliaLang/Downloads.jl#110 (comment) Or perhaps something else to do with our the way Downloads.jl integrates with curl. Downloads doesn't use the same easy handles from different threads so that should be ok. But IIUC there's other data which is implicitly shared by linking all the easy handles to the same multi handle (roughly to the same |
From what is mentioned for
Even though we do not enable connection cache sharing, we would not be able to use the same downloader or even the same HTTP/2 connection across threads. Using a per thread gRPC client should abide by these restrictions, and unless there are more caveats things should work fine. |
ref: JuliaLang/Downloads.jl#110