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

Executor#run fails for 10 tests for JRuby #23

Open
vipulnsward opened this issue Mar 7, 2013 · 7 comments
Open

Executor#run fails for 10 tests for JRuby #23

vipulnsward opened this issue Mar 7, 2013 · 7 comments
Assignees

Comments

@vipulnsward
Copy link
Member

fork isn't implemented for jruby. So Executor fails with NotImplementedError.
@emboss do you want me to give this a try using https://github.com/headius/spoon or any other alternative.

@ghost ghost assigned emboss Mar 7, 2013
@emboss
Copy link
Member

emboss commented Mar 7, 2013

Yeah, spoon would be a great idea! I was thinking about making the JRuby version multi-threaded, but spoon is even better! If you'd like to, sure, give it a try!

@vipulnsward
Copy link
Member Author

@emboss I ran out of ideas trying spoon. It has spawn support which is not a good player when needed to replace fork. I am still playing around with FFI to make this work. Let me know if you had anything other in mind that could work.

@emboss
Copy link
Member

emboss commented Mar 21, 2013

Maybe you could ask some of the JRuby devs for ideas what we could do with fork? My plan initially was to completely pass on fork for the JRuby version and to use threading instead. This is under the assumption that most JRuby code will not interact with native code and that the JVM itself never crashes. Both assumptions are not entirely valid, though :) I don't know, if we can't find a good solution for fork, we might still try it that way, at least for now.

Maybe instead of having one single Executor class as we do now, make the existing one a ProcessExecutor and add a ThreadExecutor as well. On startup, we could then detect the platform we're running on and use ProcessExecutor as the default and ThreadExecutor on JRuby.

What do you think?

@vipulnsward
Copy link
Member Author

I was thinking on same grounds. But currently JRuby doesn't handle spawn/ fork as elegantly {even though fork is a bad idea} as Ruby. FFI doesn't help much either. Main problem for us is the state inherited from the forked parent. Will try for an alternative to fork

@abstractj
Copy link

Ahoy guys! Any progress on it? I saw some alternatives on Foreman https://github.com/liveh2o/foreman/blob/7ad41da59297e8b0816f719b77655175260a3428/lib/foreman/process.rb#L59 or maybe we can make use of Threads?

ps: I know about the fact that Thread and fork are totally different beasts

@vipulnsward
Copy link
Member Author

Hi, the main problem that I saw with other implementations and ours is the tracking that we are trying to do. I was going to come up with an implementation from Rails Isolation Tests instead, but Foreman looks a little promising.

I will come up with a small snippet by the end of week. I had forgotten about this before.

@abstractj
Copy link

@vipulnsward Awesome! I also saw this implementation from launchy https://github.com/copiousfreetime/launchy/pull/10/files#L1L162.

Not sure if that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants