https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112010-04-22T23:51:26ZRuby Issue Tracking SystemRuby master - Bug #3052: DRb::start_service fails to detect used porthttps://bugs.ruby-lang.org/issues/3052?journal_id=104512010-04-22T23:51:26Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul></ul><p>=begin<br>
Hi,</p>
<p>Umm, I cannot reproduce.<br>
This issue may depend on network configuration...</p>
<a name="terminal-1"></a>
<h1 >terminal 1<a href="#terminal-1" class="wiki-anchor">¶</a></h1>
<p>$ ./ruby drb_port_busy_bug.rb<br>
druby://localhost:1234<br>
Server is alive</p>
<a name="terminal-2"></a>
<h1 >terminal 2<a href="#terminal-2" class="wiki-anchor">¶</a></h1>
<p>$ ./ruby drb_port_busy_bug.rb<br>
/home/mame/work/ruby-trunk-local/lib/ruby/1.9.1/drb/drb.rb:861:in <code>initialize': Address family not supported by protocol - socket(2) (Errno::EAFNOSUPPORT) from /home/mame/work/ruby-trunk-local/lib/ruby/1.9.1/drb/drb.rb:861:in </code>open'<br>
from /home/mame/work/ruby-trunk-local/lib/ruby/1.9.1/drb/drb.rb:861:in <code>open_server' from /home/mame/work/ruby-trunk-local/lib/ruby/1.9.1/drb/drb.rb:759:in </code>block in open_server'<br>
from /home/mame/work/ruby-trunk-local/lib/ruby/1.9.1/drb/drb.rb:757:in <code>each' from /home/mame/work/ruby-trunk-local/lib/ruby/1.9.1/drb/drb.rb:757:in </code>open_server'<br>
from /home/mame/work/ruby-trunk-local/lib/ruby/1.9.1/drb/drb.rb:1342:in <code>initialize' from /home/mame/work/ruby-trunk-local/lib/ruby/1.9.1/drb/drb.rb:1630:in </code>new'<br>
from /home/mame/work/ruby-trunk-local/lib/ruby/1.9.1/drb/drb.rb:1630:in <code>start_service' from drb_port_busy_bug.rb:3:in </code>'</p>
<p>$ ./ruby -v<br>
ruby 1.9.2dev (2010-04-22 trunk 27445) [i686-linux]</p>
<p>--<br>
Yusuke Endoh <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a><br>
=end</p> Ruby master - Bug #3052: DRb::start_service fails to detect used porthttps://bugs.ruby-lang.org/issues/3052?journal_id=104532010-04-23T00:06:09Zorem (Chris Schlaeger)cschlaeger@gmail.com
<ul></ul><p>=begin<br>
I did some more tests and the problem is most likely not DRb specific.<br>
I can reproduce this with TCPSocket as well. The system was an<br>
openSUSE 11.1 and 11.2. Both have IPv6 enabled. The problem does not<br>
occur when I use 127.0.0.1 instead of localhost. Does that help?<br>
Should I do another test?</p>
<p>Chris</p>
<p>=end</p> Ruby master - Bug #3052: DRb::start_service fails to detect used porthttps://bugs.ruby-lang.org/issues/3052?journal_id=104572010-04-23T01:58:58Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul></ul><p>=begin<br>
Hi,</p>
<p>2010/4/23 Chris Schlaeger <a href="mailto:cschlaeger@gmail.com" class="email">cschlaeger@gmail.com</a>:</p>
<blockquote>
<p>I did some more tests and the problem is most likely not DRb specific.<br>
I can reproduce this with TCPSocket as well. The system was an<br>
openSUSE 11.1 and 11.2. Both have IPv6 enabled. The problem does not<br>
occur when I use 127.0.0.1 instead of localhost. Does that help?<br>
Should I do another test?</p>
</blockquote>
<p>This may be side effect of ipv6 support of ext/socket.<br>
What's printed by:</p>
<p>require "socket"<br>
p TCPServer.new("localhost", 1234).addr<br>
p TCPServer.new("localhost", 1234).addr</p>
<p>?</p>
<p>If the result is, for example:</p>
<p>["AF_INET6", 1234, "::1", "::1"]<br>
["AF_INET", 1234, "127.0.0.1", "127.0.0.1"]</p>
<p>, this is intended behavior.</p>
<p>The first drb server is bound to ::1:1234, and the second is<br>
127.0.0.1:1234.<br>
You will be able to access both servers to druby://[::1]:1234<br>
and druby://127.0.0.1:1234, respectively.</p>
<p>--<br>
Yusuke Endoh <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a></p>
<p>=end</p> Ruby master - Bug #3052: DRb::start_service fails to detect used porthttps://bugs.ruby-lang.org/issues/3052?journal_id=104602010-04-23T02:33:07Zorem (Chris Schlaeger)cschlaeger@gmail.com
<ul></ul><p>=begin<br>
On Thu, Apr 22, 2010 at 6:58 PM, Yusuke ENDOH <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a> wrote:</p>
<blockquote>
<p>This may be side effect of ipv6 support of ext/socket.<br>
What's printed by:</p>
<p> require "socket"<br>
p TCPServer.new("localhost", 1234).addr<br>
p TCPServer.new("localhost", 1234).addr</p>
<p>?</p>
<p>If the result is, for example:</p>
<p> ["AF_INET6", 1234, "::1", "::1"]<br>
["AF_INET", 1234, "127.0.0.1", "127.0.0.1"]</p>
</blockquote>
<a name="ruby19-socket-ipv6rb"></a>
<h1 >ruby19 socket-ipv6.rb<a href="#ruby19-socket-ipv6rb" class="wiki-anchor">¶</a></h1>
<p>["AF_INET6", 1234, "localhost", "::1"]<br>
["AF_INET", 1234, "localhost", "127.0.0.1"]</p>
<a name="host-localhost"></a>
<h1 >host localhost<a href="#host-localhost" class="wiki-anchor">¶</a></h1>
<p>localhost has address 127.0.0.1</p>
<p>Hope that helps. I can run more tests if needed.<br>
Chris</p>
<p>=end</p> Ruby master - Bug #3052: DRb::start_service fails to detect used porthttps://bugs.ruby-lang.org/issues/3052?journal_id=104792010-04-23T12:37:09Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Rejected</i></li></ul><p>=begin<br>
Hi,</p>
<p>This is intended behavior.</p>
<p>You can actually run two drb servers at the time on your<br>
environment. One can be accessed via druby://[::1]:1234,<br>
and the other can be druby://127.0.0.1:1234.<br>
You will see error when attempting to invoke the third<br>
drb server.<br>
There is problem nowhere.</p>
<p>If you dislike this behavior, use druby://127.0.0.1:1234<br>
as server URL, instead of druby://localhost:1234.<br>
Or, disabling ipv6 on your SuSE configuration will also<br>
work, though I don't encourage you to do it.</p>
<p>And, thank you for your quick response!</p>
<p>--<br>
Yusuke Endoh <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a><br>
=end</p>