Bug #7311 DRb test suite fails when hostname cannot be reached

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

$B$A$g$C$H65$($F$/[email protected]$5$$!#(B
hostname$B$,@_Dj$5$l$F$$$F$=$3$K<+?H$+$i(BIP$B$,FO$+$J$$%1!<%9$G(B
dRuby$B$N%F%9%H$,<:GT$9$k$H$N$3$H$G$9!#(B($B$?$V$s(B)

$B;d$O!"$3$N>u67$KBP1~$9$k$Y$-$+$I$&$+LB$C$F$$$^$9!#(B

$B%j%8%’%/%H$NJ8LL9M$($k$N$,$7$s$I$$$N$G!"%Q%C%A(B2$B$N%$%s%G%s%H$r(B
[email protected]$7$F<h$j9~$b$&$+$H;W$&$s$G$9$,!"$=$&[email protected]$H$7$F!"$=$&$$$C$?(B
$B%1!<%9$r$I$&:F8=$7$F$h$$$N$+$bJ,$+$j$^$;$s!#(B

$B$I$&$9$k$Y$-$G$7$g$&!#[email protected]$1$^$;$s$+!)(B

(1) $BBP1~$9$kI,MW$O$J$$(B
(2) $BBP1~$9$k$Y$-(B
(2-a) $BBP1~$9$k$J$i%F%9%H=q$1$h$J!)(B
(2-b) $BBP1~$7$F$b%F%9%H$O$+$s$Y$s$7$F$d$k!#(B

===================================================================
— lib/drb/drb.rb (revision 39300)
+++ lib/drb/drb.rb (working copy)
@@ -844,6 +844,9 @@
def self.getservername
host = Socket::gethostname
begin

  •    raise unless Socket::ip_address_list.detect {|i|
    
  •      i.ip_address == Addrinfo.ip(host).ip_address
    
  •    }
       Socket::gethostbyname(host)[0]
     rescue
       'localhost'

$B$&$*!#(B
$B$9$4$$%?%$%_%s%0$G(Bmame$B$5$s$,=hM}$7$F$/$l$F$$$k(B!!(9$BJ,A0(B)

2013$BG/(B2$B7n(B19$BF|(B 0:39 Masatoshi SEKI
[email protected]:

hostname$B$,@_Dj$5$l$F$$$F$=$3$K<+?H$+$i(BIP$B$,FO$+$J$$%1!<%9$G(B
dRuby$B$N%F%9%H$,<:GT$9$k$H$N$3$H$G$9!#(B($B$?$V$s(B)

$B;d$O!"$3$N>u67$KBP1~$9$k$Y$-$+$I$&$+LB$C$F$$$^$9!#(B

$B$I$&$9$k$Y$-$G$7$g$&!#[email protected]$1$^$;$s$+!)(B

(1) $BBP1~$9$kI,MW$O$J$$(B
(2) $BBP1~$9$k$Y$-(B

$B$A$g$C$HD4$Y$?$s$G$9$,!"BP1~$9$Y$-$+$I$&$+$K$D$$$F$O(B
$B$I$A$i$G$bM}M3$r$D$1$i$l$k$h$&$J5$$,$7$^$9!#(B

$BBP1~$9$kI,MW$O$J$$(B:
gethostname $B$O(B 4.2BSD $B$GF3F~$5$l$?$b$N$G!"$=$b$=$b:G=i$+$i(B
gethostbyname $B$G$-$k$3$H$,A[Dj$5$l$F$$$k!#(B
$B$7$?$,$C$F!"(Bgethostbyname ($B8=:_$J$i(B getaddrinfo)
$B$G$-$J$$$h$&$J4D6-$,0-$$!#(B

$BBP1~$9$k$Y$-(B:
$B%[%9%H$N(B IP
$B%"%I%l%9$O%+!<%M%kFb$N%M%C%H%o!<%/%$%s%?!<%U%’!<%[email protected]_Dj$J$N$KBP$7!"(B
getaddrinfo $B$GD4$Y$i$l$k$N$O(B /etc/hosts $B$d(B DNS
$B%5!<%[email protected]_Dj$G$"$C$F!"(B
$B0[[email protected]_Dj$G7h$^$k>pJs$J$N$G?)$$0c$&[email protected]$O>o$K$"$k!#(B
DHCP $B$NIa5Z$K$h$C$F(B IP
$B%"%I%l%9$,8GDj$G$J$$$3$H$bEv$?$jA0$K$J$C$?:#!"(B
/etc/hosts $B$K%[%9%H$N(B IP
$B%"%I%l%9$r$I$N$h$&$K5-=R$9$Y$-$+$O<[email protected]$G$O$J$/!"(B
hostname $B$+$i(B IP $B%"%I%l%9$rD4$Y$i$l$k$HA[Dj$9$k$Y$-$G$J$$!#(B
$B$=$s$J>pJs$K0MB8$9$k(B dRuby $B$,0-$$!#(B

2013$BG/(B2$B7n(B20$BF|(B 9:48 Tanaka A. [email protected]:

gethostname $B$O(B 4.2BSD $B$GF3F~$5$l$?$b$N$G!"$=$b$=$b:G=i$+$i(B

$B$&!"$A$g$C$H$^$A$,$$!#(BUCB 4.1A $B$i$7$$$G$9!#(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs