Bug 621229

Summary: Cumin binds inet6 address only
Product: Red Hat Enterprise MRG Reporter: Jan Sarenik <jsarenik>
Component: cuminAssignee: messaging-bugs <messaging-bugs>
Status: CLOSED NOTABUG QA Contact: Jan Sarenik <jsarenik>
Severity: medium Docs Contact:
Priority: medium    
Version: DevelopmentCC: jross
Target Milestone: 1.3   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-09-08 12:06:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Sarenik 2010-08-04 14:56:18 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Jan Sarenik 2010-08-04 15:02:01 UTC
Excuse me, I pressed ENTER too early...

The problem is that if hostname resolves to both ipv6 and ipv4 address,
cumin will bind only to ipv6.

e.g.

/etc/hosts contents:
10.34.32.136     ooo.englab.brq.redhat.com ooo
2620:52:0:2223:21a:a0ff:feac:f08f   ooo.englab.brq.redhat.com ooo

/etc/cumin/cumin.conf:
[web]
# log-file: $CUMIN_HOME/log/web.log
host: ooo
port: 45672


When I delete the line containing IPv6 address from /etc/hosts (and
there is no AAAA record for it in DNS), it binds to IPv4 address.

I would expect it to bind to all addresses which the hostname resolves
to.

Comment 2 Justin Ross 2010-09-08 12:06:40 UTC
This is a python behavior, not a cumin one.  (And maybe not even just a python behavior.)

From http://docs.python.org/library/socket.html :

"If you use a hostname in the host portion of IPv4/v6 socket address, the program may show a nondeterministic behavior, as Python uses the first address returned from the DNS resolution. The socket address will be resolved differently into an actual IPv4/v6 address, depending on the results from DNS resolution and/or the host configuration. For deterministic behavior use a numeric address in host portion."

I suspect that linux for whatever reason is returning the ip6 address first, and as you point out, python sockets only bind to one address.