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

DM-26526: Can't run RawIngestTask with processes != 1 #294

Merged
merged 3 commits into from Sep 9, 2020

Conversation

kfindeisen
Copy link
Member

This PR fixes two issues that were preventing the use of the processes argument with RawIngestTask and DefineVisitsTask: support for pickling task instances, and use of local (i.e., non-picklable) callables to implement processing steps.

Unfortunately, this functionality cannot be checked through unit tests, because calling either RawIngestTask.run or DefineVisitsTask.run requires a Camera object, which the hypothetical "DummyCam" doesn't have.

Copy link
Member

@TallJimbo TallJimbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

I don't think I had any line comments. The fact that multiprocessing can't handle local callables is not surprising in retrospect, but it still makes me sad about how really fundamental functional programming elements are sort of only halfway supported in Python. But I've got no complaints about your workaround.

Multiprocessing does not work with local callables (because they
can't be pickled), and well-performing frameworks like imap_unordered
require unary callables. I used private wrapper methods to satisfy
both requirements.
@kfindeisen kfindeisen merged commit 12e5eb2 into master Sep 9, 2020
@kfindeisen kfindeisen deleted the tickets/DM-26526 branch September 9, 2020 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants