[Assigned] Rinda has a race condition

Issue #372 has been updated by Motohiro KOSAKI.

Category set to ext
Status changed from Rejected to Assigned
Assignee set to Masatoshi Seki
Target version set to 1.9.x
ruby -v set to -

redmineにうまく転写されてないようですが、テストの問題とのことなので、
reopenのうえ咳さんにアサインします。


Bug #372: Rinda has a race condition

Author: Anonymous
Status: Assigned
Priority: Low
Assignee: Masatoshi Seki
Category: ext
Target version: 1.9.x
ruby -v: -

=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

$B$-$7$b$H$G$9(B

Rinda::TupleSpaceProxyTest#test_core_03_notify$B$,!"$^$@!"$?$^$K(Bfail$B$K(B
$B$J$j$^$9!#(B

  1. Failure:
    test_core_03_notify(Rinda::TupleSpaceProxyTest)
    [/export/home/ksmakoto/ruby-working/rub
    y194/ruby-git/test/rinda/test_rinda.rb:372]:
    <[“delete”, {“message”=>“second”, “name”=>“1”}]> expected but was
    <[“close”]>.

$B<j85$N(B trunk$B!J(Br33066$B!K$G!"(B
make test-all TESTS=’-vn test_core_03_notify rinda/test_rinda.rb’
$B$r(B10$BK|2s<B9T$7$F$$?$H$3$m!"(B1384$B2s(Bfail$B$K$J$j!"(B
Rinda::TupleSpaceProxyTest#test_core_03_notify $B$G(B 8$B2s!"(B
Rinda::TupleSpaceTest#test_core_03_notify $B$G(B 11$B2s!"(B
$B;I$5$C$F(B(?)$B;
$^$C$?$N$G(B kill $B$7$^$7$?!#(B

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

On 2011/08/27, at 13:41, KISHIMOTO, Makoto wrote:

$B<j85$N(B trunk$B!J(Br33066$B!K$G!"(B
make test-all TESTS=’-vn test_core_03_notify rinda/test_rinda.rb’
$B$r(B10$BK|2s<B9T$7$F$$?$H$3$m!"(B1384$B2s(Bfail$B$K$J$j!"(B
Rinda::TupleSpaceProxyTest#test_core_03_notify $B$G(B 8$B2s!"(B
Rinda::TupleSpaceTest#test_core_03_notify $B$G(B 11$B2s!"(B
$B;I$5$C$F(B(?)$B;
$^$C$?$N$G(B kill $B$7$^$7$?!#(B

$B$=$&$G$9$+(B…$B!#(B
$B$3$N%F%9%H!"$b$&:o=|$7$?$$$1$I!"$,$s$P$s$J$$$H$@$a(B?

(2011/08/27 14:58), Masatoshi SEKI wrote:

test_core_03_notify(Rinda::TupleSpaceProxyTest)
[/export/home/ksmakoto/ruby-working/rub

$B$=$&$G$9$+(B…$B!#(B
$B$3$N%F%9%H!"$b$&:o=|$7$?$$$1$I!"$,$s$P$s$J$$$H$@$a(B?

$B31$5$s$,%a%s%F$5$l$F$$$k$N$G!“31$5$s$N0U;WM%@h$G$$$$$H;W$&$N$G$9$,!”(B
$B;29M$^$G$KM}M3$r65$($FLc$($^$;$s$+!#<+J,$OL5:a$C$]$$$1$IDI$$@Z$l$J$$!"(B
$B$H$+$J$i!"<jEA$&$H$+$$$&A*Br;h$b$"$k$N$+$b$7$l$^$;$s$7!#!#!#(B

$B;I$5$C$F$k$N$OJ|CV$7$F$F$$$$$N$+$J!#$H$$$&$N$,<c435$$K$J$j$^$9(B

On 2011/08/27, at 15:16, KOSAKI Motohiro wrote:

  1. Failure:
    $B;I$5$C$F(B(?)$B;_$^$C$?$N$G(B kill $B$7$^$7$?!#(B

$B$=$&$G$9$+(B…$B!#(B
$B$3$N%F%9%H!"$b$&:o=|$7$?$$$1$I!"$,$s$P$s$J$$$H$@$a(B?

$B31$5$s$,%a%s%F$5$l$F$$$k$N$G!“31$5$s$N0U;WM%@h$G$$$$$H;W$&$N$G$9$,!”(B
$B;29M$^$G$KM}M3$r65$($FLc$($^$;$s$+!#<+J,$OL5:a$C$]$$$1$IDI$$@Z$l$J$$!"(B
$B$H$+$J$i!"<jEA$&$H$+$$$&A*Br;h$b$"$k$N$+$b$7$l$^$;$s$7!#!#!#(B

$B;I$5$C$F$k$N$OJ|CV$7$F$F$$$$$N$+$J!#$H$$$&$N$,<c435$$K$J$j$^$9(B

$BJ|CV$O$@$a$G$9$M!#(B

$B$b$&$A$g$C$HD4$Y$F=u$1$F$b$i$$$^$9!#(B