Bug #376

Rinda has a race condition

Added by Yusuke Endoh about 7 years ago. Updated over 4 years ago.

[ruby-dev:35646]
Status:Rejected
Priority:Normal
Assignee:Yusuke Endoh
ruby -v: Backport:

Description

=begin
遠藤です。

現在 make test-all で Rinda のテストは無効化されています。

1) Failure:
test_message(Rinda::TupleSpaceTest)
[/home/mame/work/ruby19/ruby/test/rinda/test_rinda.rb:497]:
YARV doesn't support Rinda.

「有効化すると Rinda のテストで固まるから」とささださんに聞きました。
この問題は YARV がマージされた時から、ずっと放置されています。

調べていて気づいたのですが、以下のように Rinda に遅延を発生させると

Index: lib/rinda/tuplespace.rb
===================================================================
--- lib/rinda/tuplespace.rb (revision 18194)
+++ lib/rinda/tuplespace.rb (working copy)
@@ -570,6 +570,7 @@
keep_clean
sleep(@period)
end
+ sleep 3
end
end

以下で deadlock detected になります。1.8 でも同様です。

$ ./ruby -rrinda/tuplespace -e '
ts = Rinda::TupleSpace.new(1)
ts.take([:foo, :bar], 1) rescue nil
sleep 2
ts.take([:foo, :bar], 1)
'
/home/mame/work/ruby19/local/lib/ruby/1.9.0/thread.rb:68:in sleep':
deadlock detected (fatal)
from /home/mame/work/ruby19/local/lib/ruby/1.9.0/thread.rb:68:in
wait'
from /home/mame/work/ruby19/local/lib/ruby/1.9.0/monitor.rb:97:in wait'
from /home/mame/work/ruby19/local/lib/ruby/1.9.0/rinda/tuplespace.rb:198:in
wait'
from /home/mame/work/ruby19/local/lib/ruby/1.9.0/rinda/tuplespace.rb:465:in
block in move'
from /home/mame/work/ruby19/local/lib/ruby/1.9.0/monitor.rb:190:in
mon_synchronize'
from /home/mame/work/ruby19/local/lib/ruby/1.9.0/rinda/tuplespace.rb:443:in
move'
from /home/mame/work/ruby19/local/lib/ruby/1.9.0/rinda/tuplespace.rb:433:in
take'
from -e:5:in `'

--
Yusuke ENDOH mame@tsg.ne.jp
=end


Related issues

Duplicated by Ruby trunk - Bug #372: Rinda has a race condition Closed

History

#1 Updated by Koichi Sasada almost 7 years ago

  • Status changed from Open to Rejected

=begin

=end

#2 Updated by Koichi Sasada almost 7 years ago

  • Assignee set to Yusuke Endoh

=begin

=end

Also available in: Atom PDF