Bug 6588 - errors missed when connecting to host with multiple addresses and host is down
Summary: errors missed when connecting to host with multiple addresses and host is down
Status: RESOLVED FIXED
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.0.8
Hardware: Other Linux
: P3 normal (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-29 14:01 UTC by Arkadiusz Miskiewicz
Modified: 2011-01-01 16:00 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arkadiusz Miskiewicz 2009-07-29 14:01:25 UTC
I'm rsyncing from a IPv4 only machine to a machine with two addresses, one IPv4 and one IPv6 visible in DNS.

When destination machine is down then I get this error:
rsync: failed to connect to buildlogs.pld-linux.org: Address family not supported by protocol (97)
rsync error: error in socket IO (code 10) at clientserver.c(122) [sender=3.0.3]

so some errors were ignored instead of printing them.

How to reproduce, from ipv4 only machine, with ipv6 capable rsync and getaddrinfo() run:

rsync /dev/null rsync://carme.pld-linux.org

which will end with:

rsync: failed to connect to carme.pld-linux.org: Address family not supported by protocol (97)

while the missed error was:
16614 connect(3, {sa_family=AF_INET, sin_port=htons(2323), sin_addr=inet_addr("193.239.45.140")}, 16) = -1 ECONNREFUSED (Connection refused)

Maybe rsync should print all errors it encounters when connecting iif connection fails?
Comment 1 Arkadiusz Miskiewicz 2009-07-29 14:02:21 UTC
+ of course it should print which error is for which address being tried.
Comment 2 Wayne Davison 2011-01-01 16:00:37 UTC
In 3.0.8 rsync will output all the errors when it fails to connect, and note the associated address for each one.  e.g.:

  $ rsync carme.pld-linux.org::
  rsync: failed to connect to carme.pld-linux.org (193.239.45.140): Connection refused (111)
  rsync: failed to connect to carme.pld-linux.org (::2001:6a0:13f:1:0:0): Network is unreachable (101)