Giter Site home page Giter Site logo

Comments (4)

mrbean-bremen avatar mrbean-bremen commented on June 7, 2024 1

Not really. The problem is the mixture of faked on non-faked calls, e.g. the usage of faked descriptors in the real fs and vice verse. Even if you would map this into the fake fs, the returned descriptors would still be from the real fs (due to the C calls), which do not exist in the fake fs (or if they do exist, they point to something else, which could lead to all kinds of undefined behavior).
Sometimes it makes sense to pause patching in a test, execute something in the real fs, and resume patching again, but this won't work in this case.
It could be possible to write a fake version of posixshmem and patch the usage accordingly, but I think this wouldn't work either because of other problems in multiprocessing. The biggest problem is probably that the fake fs will not work in spawed processes in principle - and as these are the point of multiprocessing, I see no real way to fix this - sorry!

from pyfakefs.

mrbean-bremen avatar mrbean-bremen commented on June 7, 2024

Unfortunately, this won't work, at least not out of the box, due to the limitations of pyfakefs. Multiprocessing is one of the modules not playing nice with pyfakefs due to the use of system C functions to access the file system. In this case, it uses posixshmem, which is a C module, to access the shared memory. This will work in the real filesystem, so either the file is not found, or if the file exists there, a real file descriptor is returned, which is not found in the fake filesystem.

I could not reproduce the inifinite loop so far, but I got another error related to the mentioned problem. Currently, I don't have a solution for this (other than patching it away).

from pyfakefs.

samtygier-stfc avatar samtygier-stfc commented on June 7, 2024

Thanks for having a look.
Is there a way to allow this to pass through to the real filesystem? I tried self.fs.add_real_directory("/dev/shm/",read_only=False) which did not help.
It looks like the point in resource_tracker.py where this fails is with a pipe in a spawned process.

from pyfakefs.

mrbean-bremen avatar mrbean-bremen commented on June 7, 2024

I'm moving this to the "limitations" discussions, as there is nothing we can do here, as far as I cn see.

from pyfakefs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.