Code Monkey home page Code Monkey logo

Comments (18)

matthewtodd avatar matthewtodd commented on July 23, 2024

I also see this problem on Ruby 1.9.2 p0.

from akephalos.

Nerian avatar Nerian commented on July 23, 2024

And ruby 1.9.2p180, and Spork 0.9

from akephalos.

Nerian avatar Nerian commented on July 23, 2024

It seems to be a problem with garbage collection. I tried setting the minimum memory for the VM to be 512 MB in order to minimise Garbage collection (the default is 64 mb). But the results are the same, all test fails with the recycled object error.

Upgrading to the last jruby-jar didn't solve the problem either (but hey, all akephalos' tests pass).

I tried disabling GC, but being JRuby the statement GC.disable doesn't do anything.

Mmm....

from akephalos.

fwoeck avatar fwoeck commented on July 23, 2024

doesn't help much, but I can confirm the problem for ruby 192p180, spork 084
--Frank

from akephalos.

aaronjensen avatar aaronjensen commented on July 23, 2024

I can also confirm the problem with akephalos 0.2.5 and spork 0.9.0.rc4

from akephalos.

mattheworiordan avatar mattheworiordan commented on July 23, 2024

I too can see this issue, Ruby 1.9.2, Spork 0.9.0.rc4, Akephalos 0.2.5

from akephalos.

Nerian avatar Nerian commented on July 23, 2024

Let wait for @bernerdschaefer insight :)

from akephalos.

damrbaby avatar damrbaby commented on July 23, 2024

Also have this issue on Ruby 1.9.2 spork 0.9.0.rc Akephalos 0.2.5

from akephalos.

lightsofapollo avatar lightsofapollo commented on July 23, 2024

Any ideas on this? I would be happy to delve in if someone has a place to start. Seems like a GC issue but I defer to the experts.

from akephalos.

Nerian avatar Nerian commented on July 23, 2024

It is a problem with the GC. Akephalos uses HTMLUnit, which runs on JRuby. I suspect that some object is being garbage collected in the JRuby part. But I haven't figure it out where and I am no an expert at JRuby either :)

I have tried increasing the available memory that the java virtual machine can use, but the problem persists.

from akephalos.

lightsofapollo avatar lightsofapollo commented on July 23, 2024

I will take a look into this over the next week during my free time.

from akephalos.

jrafanie avatar jrafanie commented on July 23, 2024

I'm totally new to akephalos and never used spork but this type of error can occur with DRb if the DRb server creates an object, doesn't keep a reference to it, and a client doesn't immediately request it. The server will GC the object and the client will get another object after the GC. The server side might need to keep a class variable hash (which won't be GC'd) with references to an object at creation and remove it when the client requests it. Either that, or don't instantiate transient objects until they're requested. You would have to see where the DRb objects are instantiated, in akephalos or in spork, and actually used.

from akephalos.

lightsofapollo avatar lightsofapollo commented on July 23, 2024

Great hint. I will boot up a new rails 3 app tonight to see if I can figure out what specifically is being GC'd then requested.

from akephalos.

Nerian avatar Nerian commented on July 23, 2024

@lightsofapollo: How did it go? Any improvements?

from akephalos.

lightsofapollo avatar lightsofapollo commented on July 23, 2024

Nothing yet, still working on it. Taking some time off in three weeks. I will be able to focus more on it then if I don't figure it out in my spare time before then. Like your fork by the way.

from akephalos.

fcheung avatar fcheung commented on July 23, 2024

I don't think this is a GC issue - the issue appears to be that when test codes talks to akephalos' remote drb object it uses the wrong uri when constructing proxy object for blocks, so ruby then tries to invoke the block in the spork parent process rather than the process actually running the features/specs (note that in the backtrace the error is thrown from druby://127.0.0.1:8989 which is the uri for the service spork advertises).

I've put a longer discussion along with a workaround that works for my cucumber specs at http://spacevatican.org/2011/7/3/sporking-with-akephalos

from akephalos.

Nerian avatar Nerian commented on July 23, 2024

@fchenung: Good work!

from akephalos.

lightsofapollo avatar lightsofapollo commented on July 23, 2024

@fchenung: Excellent Job. Nice write up too.

We should add this to the docs of Spork in the short term.

from akephalos.

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.