Bug 1125276 - ab fails when domain name resolved to IPv6 adress
Summary: ab fails when domain name resolved to IPv6 adress
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: httpd
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Web Stack Team
QA Contact: Martin Frodl
URL:
Whiteboard:
Depends On: 1125269 1209552
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-31 13:23 UTC by Martin Frodl
Modified: 2015-11-19 04:36 UTC (History)
4 users (show)

Fixed In Version: httpd-2.4.6-32.el7
Doc Type: Bug Fix
Doc Text:
Prior to this update, the ab utility tried to connect only to the first address of the domain. Consequently, when the first returned address was unreachable but the others were reachable, ab failed. This bug has been fixed, and ab now tries to connect to all addresses returned during domain name resolution.
Clone Of: 1125269
Environment:
Last Closed: 2015-11-19 04:36:07 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2194 normal SHIPPED_LIVE httpd bug fix and enhancement update 2015-11-19 08:05:27 UTC

Description Martin Frodl 2014-07-31 13:23:46 UTC
+++ This bug was initially created as a clone of Bug #1125269 +++

Description of problem:

When ab is run for a domain name which resolves to an IPv6 address first, it exits with failure even if the domain name can be resolved to an IPv4, too:

--------------------------------------------------------------------------------
$ ab http://www.apache.org/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.apache.org (be patient)...apr_socket_recv: Network is unreachable (101)
--------------------------------------------------------------------------------

This error message is similar to the one printed by wget for the same URL in the first phase. Unlike ab, wget tries to resolve the domain name to IPv4 once IPv6 has failed:

--------------------------------------------------------------------------------
$ wget http://www.apache.org/
--2014-07-31 08:51:58--  http://www.apache.org/
Resolving www.apache.org... 2001:610:1:80bc:192:87:106:229, 192.87.106.229, 140.211.11.131
Connecting to www.apache.org|2001:610:1:80bc:192:87:106:229|:80... failed: Network is unreachable.
Connecting to www.apache.org|192.87.106.229|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 41041 (40K) [text/html]
Saving to: `index.html'

100%[======================================>] 41,041      97.2K/s   in 0.4s

2014-07-31 08:51:59 (97.2 KB/s) - `index.html' saved [41041/41041]
--------------------------------------------------------------------------------

It seems that ab works fine exactly for those domain names which resolve to IPv4 only, i.e. those which are not resolved to IPv6 first:

--------------------------------------------------------------------------------
$ ab http://www.redhat.com/
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.redhat.com (be patient).....done


Server Software:        Apache-Coyote/1.1
Server Hostname:        www.redhat.com
Server Port:            80

Document Path:          /
Document Length:        75730 bytes

Concurrency Level:      1
Time taken for tests:   1.705 seconds
Complete requests:      1
Failed requests:        0
Write errors:           0
Total transferred:      76285 bytes
HTML transferred:       75730 bytes
Requests per second:    0.59 [#/sec] (mean)
Time per request:       1705.085 [ms] (mean)
Time per request:       1705.085 [ms] (mean, across all concurrent requests)
Transfer rate:          43.69 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       47   47   0.0     47      47
Processing:  1658 1658   0.0   1658    1658
Waiting:     1436 1436   0.0   1436    1436
Total:       1705 1705   0.0   1705    1705


$ wget http://www.redhat.com/
--2014-07-31 15:03:44--  http://www.redhat.com/
Resolving www.redhat.com (www.redhat.com)... 2.17.39.214
Connecting to www.redhat.com (www.redhat.com)|2.17.39.214|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html’

    [ <=>                                                                                                                                                 ] 75,725      --.-K/s   in 0.1s    

2014-07-31 15:03:46 (690 KB/s) - ‘index.html’ saved [75725]
--------------------------------------------------------------------------------

It seems reasonable to me to follow wget's example and don't give up after IPv6 connection fails but rather try the IPv4 instead.

Version-Release number of selected component (if applicable):
httpd-tools-2.2.15-31.el6_5

Comment 8 errata-xmlrpc 2015-11-19 04:36:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2194.html


Note You need to log in before you can comment on or make changes to this bug.