-
-
Notifications
You must be signed in to change notification settings - Fork 718
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
"can't pickle thread.lock objects" when calling array.store with distributed #780
Comments
Seems related to dask/dask#1683. |
Can you try the following # data.store(store)
from dask.utils import SerializableLock
lock = SerializableLock()
data.store(store, lock=lock) |
It works with Is there a way to make this the default? |
p.s. I had to update to dask. 0.13.0 in order to be able to import the SerializableLock. |
We could make it the default, yes. I suppose it doesn't have much overhead over standard locks. |
This just came in. You could ping there and see if he's interested in implementing this as well: dask/knit#60 |
So with Should I raise this issue over at xarray then? (I must admit I don't see the relevance of dask/knit#60 to this issue.) |
Sorry, wrong copy-paste: dask/dask#1879 |
Or you could also implement this yourself. Should be an easy change and it'd be good to have your name in the authors list :) (or I can do it, but that's boring) |
We built SerializableLock with XArray in mind. I think that they started using it as well in some cases. cc @shoyer |
Ah, it looks like there is already an xarray PR in progress that would address this: pydata/xarray#1179 |
Just ran into this too. Is it feasible to extend cloudpickle to dispatch |
I think that cloudpickle should probably still err when trying to serialize a lock. This is usually an unsafe thing to do I think. |
@pelson would the solution in either of the two PRs suffice for you? I'm happy to spend some time to make this workable. |
As it happens, I'm not sure it was exactly the same issue (as in, line of code within distributed).
And was able to determine it was a completely different thread lock I had hold of...
I got rid of my global logger and the issue disappeared. This is really a cloudpickle issue, not distributed.
💣 Sorry for the noise on this issue. Happy to move this over to cloudpickle if it is helpful? |
Also saw similar issues. FWIW |
@rabernat is your original issue resolved? |
I believe it is not resolved because dask/dask#1881 has not been merged yet. It is awaiting a test which I have not had time to figure out how to write. |
hi. @mrocklin is there an update on this issue? |
I'm not sure that there is anything we can do here. In principle
SerializableLock assumes that the place you're storing to can be written to
from separate processes without coordination. That might not be true.
It would be good to improve error reporting, to point users to this option
if it's right for them. I don't know of a good way of doing that though.
If anyone has suggestions on how to improve this that would be helpful.
…On Thu, Apr 25, 2019 at 6:30 AM sharath nair ***@***.***> wrote:
hi. @mrocklin <https://github.com/mrocklin> is there an update on this
issue?
Are we still to use the SerializableLock?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#780 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACKZTFQYOZKQ3WOBTDRY43PSGI4VANCNFSM4C3HBJIQ>
.
|
I am trying to store a dask array using distributed. When I call
store
, I get an error "can't pickle thread.lock objects".I originally was trying this in a much more complex context involving netCDF, xarray, etc. But I managed to come up with the following minimal example.
The first call works, but the second fails. The output is:
Versions:
The text was updated successfully, but these errors were encountered: