Closed vemv closed 4 years ago
I don't think this one is relate to fork_break at all and from what I see it will be harder to debug.
My current hypothesis here is that when running the rails console (or runner) the data marshalling capabilities of Fork somehow do not work.
I'll try to investigate a little bit further.
Thank you!
I added to my repo a rake task, which also exhibits this bug.
Maybe I made some silly error... can you check my individual commits? They're small/clean.
I have the same problem.
@zeitnot Is it while running rails runner
?
Unfortunately Rails runner wraps some objects with bindings so they cannot be marshalled.
Some objects cannot be dumped: if the objects to be dumped include bindings, procedure or method objects, instances of class IO, or singleton objects, a TypeError will be raised.
given the following super-simple class:
running
rails runner Foo.demo
will throw the following:Same if I try to execute
Foo.demo
from arails c
session. With the only difference that I have to press Contol + D to get the error, else it hangs.I was able to recreate this in a Rails project from scratch: https://github.com/vemv/fork_break_bug_repro
It doesn't affect whether one is using fork_break master, or the commit from yesterday for #13. I also tried different things and couldn't get the code to work.
In the real project in which I am using fork_break, fork_break runs generally fine, but I think I found a subtle bug which I'm attempting to recreate in isolation. Maybe that bug and this bug are the same.
Cheers - Victor