Rinda has a race condition

Issue #372 has been updated by Makoto K…

  1. Failure:
    test_core_03_notify(Rinda::TupleSpaceProxyTest)
    [/home/mame/work/ruby19/ruby/test/rinda/test_rinda.rb:397]:
    <[0, 3]> expected but was
    <[1, 2]>.

非常にごくまれに(1回も再現できていません)trunk でもこれが起きることがあるようです。

  1. Failure:
    test_core_03_notify(Rinda::TupleSpaceTest)
    [/export/home/ksmakoto/ruby-working/ruby194/ruby-git/test/rinda/test_rinda.rb:398]:
    <[0, 3]> expected but was
    <[1, 2]>.

という 1F を確認しました。
FreeBSD 8.2-STABLE で r32672 です。

Bug #372: Rinda has a race condition

Author: Anonymous
Status: Rejected
Priority: Low
Assignee:
Category:
Target version:

=begin
咳といいます。

1.8系のtuplespace.rbを修正した覚えがあるのですが、
1.8系でもやっぱりだめでしょうか?

どちらにせよ、1.8のtuplespace.rbを1.9へ
ciしようと思いますので、
よかったらあとでもう一度ためしてもらえますか?
#いまビルド中なのでしばらく待ってください

On 2008/07/24, at 22:22, Yusuke ENDOH wrote:

調べていて気づいたのですが、以下のように 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 でも同
様です。

似たようなところで遅延させたんですが、こんな感じです。

Index: lib/rinda/tuplespace.rb

— lib/rinda/tuplespace.rb (revision 18222)
+++ lib/rinda/tuplespace.rb (working copy)
@@ -622,6 +622,7 @@
break unless need_keeper?
keep_clean
end
+sleep(3)
end
end
end

$ ./ruby -rrinda/tuplespace -e ’
ts = Rinda::TupleSpace.new(1)
ts.take([:foo, :bar], 1) rescue nil
sleep 2
ts.take([:foo, :bar], 1)

/usr/local/lib/ruby/1.8/rinda/tuplespace.rb:503:in move': Rinda::RequestExpiredError (Rinda::RequestExpiredError) from /usr/local/lib/ruby/1.8/monitor.rb:242:in synchronize’
from /usr/local/lib/ruby/1.8/rinda/tuplespace.rb:488:in move' from /usr/local/lib/ruby/1.8/rinda/tuplespace.rb:479:in take’
from -e:5
=end

$B31$H$$$$$^$9!#(B

On 2011/07/26, at 11:57, Makoto K. wrote:

$BHs>o$K$4$/$^$l$K!J(B1$B2s$b:F8=$G$-$F$$$^$;$s!K(Btrunk
$B$G$b$3$l$,5/$-$k$3$H$,$"$k$h$&$G$9!#(B

  1. Failure:
    test_core_03_notify(Rinda::TupleSpaceTest)
    [/export/home/ksmakoto/ruby-working/ruby194/ruby-git/test/rinda/test_rinda.rb:398]:
    <[0, 3]> expected but was
    <[1, 2]>.

$B$H$$$&(B 1F $B$r3NG’$7$^$7$?!#(B
FreeBSD 8.2-STABLE $B$G(B r32672 $B$G$9!#(B

test_core_03_notify$B$N%F%9%H!"$I$l$b%9%l%C%I$N%?%$%_%s%0$K0MB8$7$F$F%@%a$=$&$G$9!#(B
MockClock$B$G@)8f$G$-$k$H;W$C$?$1$I4E$+$C$?(B…$B!#(B

$B%9%l%C%I;H$o$J$$$GI=8=$G$-$k$+;n$7$F$_$^$9!#(B

$B$H$$$&$h$j!"$J$s$N%F%9%H$@$C$?$+;W$$=P$;$J$$!#(B

Bug #4160 $B$bF1MM$@$H;W$$$^$9!#(B

$B31$H$$$$$^$9!#(B

On 2011/07/26, at 11:57, Makoto K. wrote:

$BHs>o$K$4$/$^$l$K!J(B1$B2s$b:F8=$G$-$F$$$^$;$s!K(Btrunk
$B$G$b$3$l$,5/$-$k$3$H$,$"$k$h$&$G$9!#(B

  1. Failure:
    test_core_03_notify(Rinda::TupleSpaceTest)
    [/export/home/ksmakoto/ruby-working/ruby194/ruby-git/test/rinda/test_rinda.rb:398]:
    <[0, 3]> expected but was
    <[1, 2]>.

$B$H$$$&(B 1F $B$r3NG’$7$^$7$?!#(B
FreeBSD 8.2-STABLE $B$G(B r32672 $B$G$9!#(B

test_core_03_notify$B$N%F%9%H!"$I$l$b%9%l%C%I$N%?%$%_%s%0$K0MB8$7$F$F%@%a$=$&$G$9!#(B
MockClock$B$G@)8f$G$-$k$H;W$C$?$1$I4E$+$C$?(B…$B!#(B

$B%9%l%C%I;H$o$J$$$GI=8=$G$-$k$+;n$7$F$_$^$9!#(B

$B$H$$$&$h$j!"$J$s$N%F%9%H$@$C$?$+;W$$=P$;$J$$!#(B

Bug #4160 $B$bF1MM$@$H;W$$$^$9!#(B