JRuby ConcurrencyError #77

Closed
mwotton opened this Issue Mar 21, 2013 · 7 comments

Comments

Projects
None yet
3 participants
@mwotton

mwotton commented Mar 21, 2013

Is ruote expected to work with JRuby? Very intermittently, I've been getting errors in wait_logger.rb:

fei: engine_id: engine wfid: 20130321-0746-johenoshi-geguteha subid: !binary |- ZTc3ZTA1ZDg3YzZjNGQwZjA1OGZhZmU4YzQ5YjQxY2Q= expid: '0_0' at: '2013-03-21 07:46:14.107000 UTC' class:
ConcurrencyError message: Detected invalid array contents due to unsynchronized modifications with concurrent users trace: - org/jruby/RubyArray.java:1147:in `<<' 
              - "/home/mwotton/.rvm/gems/jruby-head/gems/ruote-2.3.0.1/lib/ruote/log/wait_logger.rb:102:in\ \ `on_msg'" 
              - "/home/mwotton/.rvm/gems/jruby-head/gems/ruote-2.3.0.1/lib/ruote/context.rb:199:in\ \ `notify'" 
              - org/jruby/RubyArray.java:1613:in `each' - "/home/mwotton/.rvm/gems/jruby-head/gems/ruote-2.3.0.1/lib/ruote/context.rb:199:in\ \ `notify'"
              - "/home/mwotton/.rvm/gems/jruby-head/gems/ruote-2.3.0.1/lib/ruote/worker.rb:404:in\ \ `process'" - "/home/mwotton/.rvm/gems/jruby-head/gems/ruote-2.3.0.1/lib/ruote/worker.rb:195:in\ \ `process_msgs'"
              - "/home/mwotton/.rvm/gems/jruby-head/gems/ruote-2.3.0.1/lib/ruote/worker.rb:243:in\ \ `step'" 
              - "/home/mwotton/.rvm/gems/jruby-head/gems/ruote-2.3.0.1/lib/ruote/worker.rb:94:in\ \ `run'" 
               - "/home/mwotton/.rvm/gems/jruby-head/gems/ruote-2.3.0.1/lib/ruote/worker.rb:105:in\ \ `run_in_thread'" 

details: deviations: tree: - sequence - {} - - - init_workitem - {} - [] - - run_command - command: "$f:command" - [] - - subprocess - check_content_subprocess: - [] - - calculate_result - {} - []

looking at line 102:

def on_msg(msg)

  puts(fancy_print(msg, @noisy)) if @noisy

  return if msg['action'] == 'noop'

  @seen << msg
  @log << msg

  while @log.size > @log_max; @log.shift; end
  while @seen.size > @log_max; @seen.shift; end
end

if @seen is being called from multiple threads without a GIL, it can indeed be modified concurrently, as is detailed at http://merbist.com/2011/10/18/data-safety-and-gil-removal/

@jmettraux

This comment has been minimized.

Show comment Hide comment
@jmettraux

jmettraux Mar 21, 2013

Owner

Thanks, much appreciated, I'll look into it ASAP.

Owner

jmettraux commented Mar 21, 2013

Thanks, much appreciated, I'll look into it ASAP.

@jmettraux jmettraux closed this in 6a97f14 Mar 21, 2013

@jmettraux

This comment has been minimized.

Show comment Hide comment
@jmettraux

jmettraux Mar 21, 2013

Owner

Danke schoen !

Owner

jmettraux commented Mar 21, 2013

Danke schoen !

@seen

This comment has been minimized.

Show comment Hide comment
@seen

seen Mar 21, 2013

@ mentions are fun! 😄

seen commented Mar 21, 2013

@ mentions are fun! 😄

@jmettraux

This comment has been minimized.

Show comment Hide comment
@jmettraux

jmettraux Mar 21, 2013

Owner

Sorry Sean!

Owner

jmettraux commented Mar 21, 2013

Sorry Sean!

@seen

This comment has been minimized.

Show comment Hide comment
@seen

seen Mar 21, 2013

No worries, it's not the first time, and it won't be the last! 😃

seen commented Mar 21, 2013

No worries, it's not the first time, and it won't be the last! 😃

jmettraux added a commit that referenced this issue Mar 22, 2013

@mwotton

This comment has been minimized.

Show comment Hide comment
@mwotton

mwotton Apr 7, 2013

(I know this is closed already - just wanted to record that this fix did in fact solve my intermittent problem. Cheers!)

mwotton commented Apr 7, 2013

(I know this is closed already - just wanted to record that this fix did in fact solve my intermittent problem. Cheers!)

@jmettraux

This comment has been minimized.

Show comment Hide comment
@jmettraux

jmettraux Apr 7, 2013

Owner

Cheers!

Owner

jmettraux commented Apr 7, 2013

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment