Skip to content
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

Joblib silently ignores pickle exceptions and does not use cache #896

Closed
p-himik opened this issue Jun 19, 2019 · 6 comments
Closed

Joblib silently ignores pickle exceptions and does not use cache #896

p-himik opened this issue Jun 19, 2019 · 6 comments

Comments

@p-himik
Copy link

p-himik commented Jun 19, 2019

I'm trying to use memory.cache on a function that returns a bunch of Pandas named tuples made with list(dataframe.itertuples()).
Apparently, such tuples cannot be pickled. I'm fine with that, however I'm not fine with the fact that Joblib doesn't even log the issue. Because of the empty except at https://github.com/joblib/joblib/blob/master/joblib/_store_backends.py#L193 the pickle exception is just ignored, and the hint about race condition doesn't really help to debug the issue.

@tomMoral
Copy link
Contributor

Indeed, the except to catch the directory creation race condition should probably be moved in the create_location method. I also run into some race conditions when calling in parallel a cached function that has just been modified. The workers are all trying to delete the directory at once, creating errors. I will try to fix this this week.

@tomMoral
Copy link
Contributor

Btw, if you have a reproducing case, I would be very interested, to make sure we solve the problem at hand.

@p-himik
Copy link
Author

p-himik commented Oct 14, 2019

Should be something as simple as

import joblib as jb
import pandas as pd

memory = jb.memory.Memory()

@memory.cache
def f():
  return list(pd.DataFrame({'a': [1]}).itertuples())

f()

@tomMoral
Copy link
Contributor

Note that if you do not provide an argument location= in Memory, there will be no caching in joblib.

But indeed, this example reproduce the problem.

@p-himik
Copy link
Author

p-himik commented Oct 14, 2019

Right, sorry - I was just reproducing it from my head. In the real code, I have location specified.

@jeremiedbb
Copy link
Contributor

Fixed by #1359

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants