Returning a view when memory mapping is used raises Permission error on windows#944
Returning a view when memory mapping is used raises Permission error on windows#944albertcthomas wants to merge 3 commits intojoblib:masterfrom
Conversation
2d8794d to
7efea35
Compare
Codecov Report
@@ Coverage Diff @@
## master #944 +/- ##
=========================================
Coverage ? 94.65%
=========================================
Files ? 45
Lines ? 6623
Branches ? 0
=========================================
Hits ? 6269
Misses ? 354
Partials ? 0
Continue to review full report at Codecov.
|
|
Thanks @albertcthomas . I have extended your test to make it even more interesting. It's really nice that the POSIX semantics are such that the test pass out-of-the box on Linux and macOS. Still we will have to rework the temporary file collection to have it work on windows as well. I have to think more about it but unfortunately I won't have time to work on it today. Maybe next week hopefully. |
|
And the test fails for both
And the views returned to the parent process are indeed memmaps. |
Why? If you write the same code using the threading backend you would also have shared memory. |
True :). |
|
The solution being implemented in #966 would make it such that a Parallel function calls that returns values that are views of tempory memmapped arrays automatically created by joblib from the input argument will always be materialized back as regular numpy arrays. |
|
Fixed and released in 0.15.0. |
Following #942 (comment) I added a non regression test for when a view of a memory mapped object is returned.
This raises a Permission error on windows (to be confirmed by CI). However I am not sure about the expected behavior in this case. In a way it makes sense to have an error but I don't think it is the case with macOS or linux.
Related to issue #806.