Possible Threading Issue?

25 views
Skip to first unread message

David Boyd

unread,
May 14, 2014, 2:10:21 AM5/14/14
to rfmcom...@googlegroups.com
I am using ginjo-rfm (already posted as issue on github) 

Just wondering if anyone in group can shed some light on this

I think I have found an issue possibly threading but not 100% sure.

We have SuckerPunch jobs that perform File Maker syncs keeping our FM and database in sync.

We have found an intermittent issue that we cannot reproduce,


NoMethodError: undefined method `name' for #<Hash:0x007f2b95743610>

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/ginjo-rfm-2.1.7/lib/rfm/resultset.rb:158:in `rescue in block in parse_fields'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/ginjo-rfm-2.1.7/lib/rfm/resultset.rb:158:in `block in parse_fields'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/ginjo-rfm-2.1.7/lib/rfm/resultset.rb:157:in `each'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/ginjo-rfm-2.1.7/lib/rfm/resultset.rb:157:in `parse_fields'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/ginjo-rfm-2.1.7/lib/rfm/resultset.rb:109:in `initialize'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/ginjo-rfm-2.1.7/lib/rfm/layout.rb:285:in `new'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/ginjo-rfm-2.1.7/lib/rfm/layout.rb:285:in `get_records'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/ginjo-rfm-2.1.7/lib/rfm/layout.rb:214:in `find'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/ginjo-rfm-2.1.7/lib/rfm/base.rb:260:in `find'

        /data/myi/releases/20140407053924/app/models/filemaker/fm_base.rb:7:in `find_single'

        /data/myi/releases/20140407053924/app/jobs/postback_parent_job.rb:12:in `block in perform'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/mongoid-3.1.6/lib/mongoid/relations/proxy.rb:143:in `each'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/mongoid-3.1.6/lib/mongoid/relations/proxy.rb:143:in `method_missing'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/mongoid-3.1.6/lib/mongoid/relations/embedded/many.rb:422:in `method_missing'

        /data/myi/releases/20140407053924/app/jobs/postback_parent_job.rb:11:in `perform'


Also 

NoMethodError: undefined method `name' for {"name"=>"addr_full", "data"=>{"__content__"=>"  NSW "}}:Hash

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/ginjo-rfm-2.1.7/lib/rfm/record.rb:129:in `rescue in block in initialize'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/ginjo-rfm-2.1.7/lib/rfm/record.rb:129:in `block in initialize'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/ginjo-rfm-2.1.7/lib/rfm/record.rb:127:in `each'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/ginjo-rfm-2.1.7/lib/rfm/record.rb:127:in `initialize'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/ginjo-rfm-2.1.7/lib/rfm/base.rb:111:in `new'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/ginjo-rfm-2.1.7/lib/rfm/base.rb:111:in `rescue in new'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/ginjo-rfm-2.1.7/lib/rfm/base.rb:108:in `new'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/ginjo-rfm-2.1.7/lib/rfm/record.rb:171:in `block in build_records'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/ginjo-rfm-2.1.7/lib/rfm/utilities/core_ext.rb:94:in `block in each'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/ginjo-rfm-2.1.7/lib/rfm/utilities/core_ext.rb:91:in `each'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/ginjo-rfm-2.1.7/lib/rfm/utilities/core_ext.rb:91:in `each'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/ginjo-rfm-2.1.7/lib/rfm/record.rb:170:in `build_records'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/ginjo-rfm-2.1.7/lib/rfm/resultset.rb:128:in `initialize'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/ginjo-rfm-2.1.7/lib/rfm/layout.rb:285:in `new'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/ginjo-rfm-2.1.7/lib/rfm/layout.rb:285:in `get_records'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/ginjo-rfm-2.1.7/lib/rfm/layout.rb:179:in `all'

        /data/myi/releases/20140407053924/app/jobs/load_fm_job.rb:101:in `block in sync_parents'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/mongoid-3.1.6/lib/mongoid/unit_of_work.rb:39:in `unit_of_work'

        /data/myi/releases/20140407053924/app/jobs/load_fm_job.rb:77:in `sync_parents'

        /data/myi/releases/20140407053924/app/jobs/load_fm_job.rb:16:in `perform'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in `public_send'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in `dispatch'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/celluloid-0.15.2/lib/celluloid/calls.rb:67:in `dispatch'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/celluloid-0.15.2/lib/celluloid/actor.rb:322:in `block in handle_message'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/celluloid-0.15.2/lib/celluloid/actor.rb:416:in `block in task'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/celluloid-0.15.2/lib/celluloid/tasks.rb:55:in `block in initialize'

        /data/myi/shared/bundled_gems/ruby/2.0.0/gems/celluloid-0.15.2/lib/celluloid/tasks/task_fiber.rb:13:in `block in create'




It's the same code

field_name = @layout.field_mapping[field.name] || field.name rescue field.name


So I have been looking into this issue. ginjo RFM has a core_ext.rb class that is adding methods to Hash

The methods are

 Fmpxmlresult::Resultset::Field 

def name 

  self['NAME']

end

So the error means that this process didn't work correctly. Note I have change to the code to 

field_name = @layout.field_mapping[field.name] || field.name rescue field['name'] everything 'seems' fine i.e the Hash has the value just it was never extended with a method name.

This has something to do with running multiple celluloid jobs at one time. It doesn't happen all the time and I havet yet to be able to produce a repeatable unit test. Hoping someone can shed some light on this?

Reply all
Reply to author
Forward
0 new messages