Issue Type: Bug Bug
Affects Versions: JRuby 1.6.8
Assignee: Unassigned
Components: Core Classes/Modules
Created: 13/Nov/12 7:14 AM
Description:

I am serializing Jobs to a MySQL Database (using delayed_job). While i do so, i randomly (once every few months) i get the following scenario. When i serialize a Job, the 'arguments' which is a attribute on the object gets a self reference instead of the real values. I have seed the same behavior with plain delayed_job in the same environment. I totally don't have any idea how to reproduce this scenario. But here some pseudo code:

class Calculator
  def self.add(a, b)
    # ...
  end
end

JobService.create Calculator, :add, 1, 2

This should generate a job (serialized in yaml) like this:

--- !ruby/object:Job 
arguments: [1, 2]
method: :add
object_class: Calculator
object_id: 2010

And this works most of the time. Sometime however this gets serialized:

--- &id001 !ruby/object:Job 
arguments: *id001
method: :add
object_class: Calculator
object_id: 2010

Then my job is failing obviously.

The delayed_job code with ActiveRecord specialties might have influence on that part: https://github.com/collectiveidea/delayed_job/blob/master/lib/delayed/serialization/active_record.rb
They also have some magic here: https://github.com/collectiveidea/delayed_job/blob/master/lib/delayed/psych_ext.rb
Die YAML implementation used is here:

jruby-1.6.8/lib/ruby/1.8/yaml.rb
Project: JRuby
Priority: Major Major
Reporter: Vincent Landgraf
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to