-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
File bif passthrough #36
Conversation
I've also been aware some time that mocking the modules involved with compilation and code loading is troublesome, to say the least. :-) Great summary of what goes wrong. I won't pull this in now for various reasons, the biggest being that I'm planning to (sometime) rewrite the code loading not to use the |
I had no expectations that this to be merged in without any adjustments on my end. It's good to know that you've already got an alternative solution in mind. Feel free to close this pull request and track the issue elsewhere. |
Would this be an acceptable test case for this use case?
I can trigger the deadlock calling basically any function in any module used by any module that meck is calling during reloading code (thus being inside the meck gen_server). The |
I ran this test against the master where it failed and the file-bif-passthrough branch where it passed, only thing i would change is to remove the last underscore to confuse eunit less. |
Ah, yes of course. ;-) |
Hi, what is the status of this issue? I can still feel the pain with latest master version. Is there any work to be done that I could help with to fix this issue? Mocking file:read_file will simplify some tests I want to write in a great deal ... |
How ironic, resurrecting an issue from the dead during the Easter holidays. +1 I'm also wondering what the status of this issue is. Never know when I'll have to mock the file module again. |
I'll pull down this branch and test it again. Already now I can say that I'd like the compilation state (running / not running) inside the gen_server state instead of in the process dictionary... |
@klaar I've rebased your branch onto master here: https://github.com/eproxus/meck/tree/support/klaar/file-bif-passthrough so you can get a feel for how the changes would merge onto the current master. Unfortunately the |
Any progress on this? |
I hope you are not expecting anything from my side :) |
I just ran into this as well. +1 |
@eproxus I would like to take these changes, rebase them, and adjust the unit tests as per your comment. But I am not sure if I can add my commits to this pull request, so should I just create another pull request or what? |
Please create a new pull request, this is way too far behind in commits. See if you can include the original commits so all authors can be attributed, otherwise include them in the commit message perhaps? |
@eproxus ok, will do |
You can peek at the result in my private repo under feature/file-bif-passthrough branch. It is base on the stub-all pull request and I will create a pull request for it as soon as the base is accepted. |
@horkhe Ok, didn't see that this was merged together with the refactoring branch. |
A deadlock occurs if meck is used to mock a module that is needed to recompile modules. The rough sequence of events causing the deadlock is the following when the file module is mocked:
I resolved the issue by making a worker process responsible for executing recompliation and notifying the client when the module has been reloaded. In this case it enables the file_meck server to respond to calls
during this time.