You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2024/06/07 17:05:03 UTC
[Bug 69126] New: addressttl strange behavior: checking address change before timeout, and closing connections while no change in name resolution
https://bz.apache.org/bugzilla/show_bug.cgi?id=69126
Bug ID: 69126
Summary: addressttl strange behavior: checking address change
before timeout, and closing connections while no
change in name resolution
Product: Apache httpd-2
Version: 2.4.59
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P2
Component: mod_proxy
Assignee: bugs@httpd.apache.org
Reporter: alexandre.schaff@gmail.com
Target Milestone: ---
Created attachment 39768
--> https://bz.apache.org/bugzilla/attachment.cgi?id=39768&action=edit
pcap with addressttl parameter used.
Bonjour,
New parameter addressttl for mod_proxy behave strangely.
Check for name resolution change is done for each request ( seemingly ), not
waiting for given delay.
Check for name resolution finds a difference (there is none) and closes
previous tcp connection if there was one available.
Config is:
LogLevel warn proxy:debug proxy_http:debug proxy_balancer:debug
<Location />
ProxyPass http://tornado.test.com:1443/H enablereuse=on retry=0 timeout=50
addressttl=10
</Location>
When not using addressttl in the conf, regular behavior is observed: cnx pool
reused : see regular_tcpcnxpooling.pcapng
With "addressttl=10", resolution is done every request and different resolution
is found, thus resetting tcp connection.
Sample of associated log:
[Fri Jun 07 16:44:43.228162 2024] [proxy:debug] [pid 10:tid 140214970345152]
proxy_util.c(2684): AH00942: http: has acquired connection for
(tornado.test.com:1443)
[Fri Jun 07 16:44:43.228173 2024] [proxy:debug] [pid 10:tid 140214970345152]
proxy_util.c(3086): [client 127.0.0.1:33892] AH00944: connecting
http://tornado.test.com:1443/HH_3 to tornado.test.com:1443
[Fri Jun 07 16:44:43.228478 2024] [proxy:debug] [pid 10:tid 140214970345152]
proxy_util.c(2792): [client 127.0.0.1:33892] AH10479: http: tornado.test.com
resolved to 127.0.0.10:1443
[Fri Jun 07 16:44:43.228508 2024] [proxy:debug] [pid 10:tid 140214970345152]
proxy_util.c(3023): [client 127.0.0.1:33892] AH10481: http: closing connection
to tornado.test.com (127.0.0.1:32770<>127.0.0.10:1443) on address change
To reproduce:
Use docker image: https://hub.docker.com/_/httpd
Have configuration set for proxying
Have a simple Tornado server ( compliant with KA requests from httpd mod_proxy
to keep connections alive ) on local machine.
start the docker with :
docker run --network host --add-host tornado.test.com:127.0.0.10
my-apache2:latest
Simple curl client to send 3 requests:
http://127.0.0.1:8080/H_$i
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 69126] addressttl strange behavior: checking address change before timeout, and closing connections while no change in name resolution
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69126
Alexandre Schaff <al...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #10 from Alexandre Schaff <al...@gmail.com> ---
Thank you Yann,
With the 2 patches applied it now works well with tcp connections pool.
I used a simple loop of requests every 1 second, with addressttl=5:
* dns lookup is applied every addressttl seconds
* if ip did not change: tcp connection to backend is kept alive
* if ip changed: tcp connection is closed and new one is created
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 69126] addressttl strange behavior: checking address change before timeout, and closing connections while no change in name resolution
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69126
--- Comment #12 from Yann Ylavic <yl...@gmail.com> ---
Merge to 2.4.x in r1918543, will be in upcoming 2.4.60.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 69126] addressttl strange behavior: checking address change before timeout, and closing connections while no change in name resolution
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69126
--- Comment #7 from Yann Ylavic <yl...@gmail.com> ---
Created attachment 39777
--> https://bz.apache.org/bugzilla/attachment.cgi?id=39777&action=edit
Keep conn alive if possible in ap_proxy_determine_address()
> But I am not sure where to place that in current modifications around addressttl
Maybe like this?
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 69126] addressttl strange behavior: checking address change before timeout, and closing connections while no change in name resolution
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69126
Yann Ylavic <yl...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #39777|0 |1
is obsolete| |
--- Comment #9 from Yann Ylavic <yl...@gmail.com> ---
Created attachment 39778
--> https://bz.apache.org/bugzilla/attachment.cgi?id=39778&action=edit
Keep conn alive if possible in ap_proxy_determine_address() (v2)
This v2 for the case where the connection is kept alive but the address can be
released still.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 69126] addressttl strange behavior: checking address change before timeout, and closing connections while no change in name resolution
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69126
--- Comment #4 from Yann Ylavic <yl...@gmail.com> ---
Could it be a linkage issue, i.e. is httpd running with the same APR version it
was compiled against?
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 69126] addressttl strange behavior: checking address change before timeout, and closing connections while no change in name resolution
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69126
Yann Ylavic <yl...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #39771|0 |1
is obsolete| |
--- Comment #3 from Yann Ylavic <yl...@gmail.com> ---
Created attachment 39772
--> https://bz.apache.org/bugzilla/attachment.cgi?id=39772&action=edit
Fix address expiry date computation in ap_proxy_determine_address()
Better patch.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 69126] addressttl strange behavior: checking address change before timeout, and closing connections while no change in name resolution
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69126
--- Comment #5 from Yann Ylavic <yl...@gmail.com> ---
^ Sorry wrong ticket..
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 69126] addressttl strange behavior: checking address change before timeout, and closing connections while no change in name resolution
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69126
--- Comment #2 from Yann Ylavic <yl...@gmail.com> ---
Created attachment 39771
--> https://bz.apache.org/bugzilla/attachment.cgi?id=39771&action=edit
Fix current address expiry compution in ap_proxy_determine_address()
Could you please try this patch?
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 69126] addressttl strange behavior: checking address change before timeout, and closing connections while no change in name resolution
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69126
--- Comment #8 from Yann Ylavic <yl...@gmail.com> ---
> Created attachment 39777
This is to be applied on top of attachment 39772 still.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 69126] addressttl strange behavior: checking address change before timeout, and closing connections while no change in name resolution
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69126
--- Comment #6 from Alexandre Schaff <al...@gmail.com> ---
Thank you Yann for the quick patch.
I was able to test only today.
With patch, the name resolution is done only after it hasn't been done for
addressttl seconds. Then it is redone only after addressttl seconds have passed
again.
But, even if name resolution gives the same ip, all connections pooled to that
ip:port are closed and re-opened.
A call to proxy_addrs_equal(const apr_sockaddr_t *addr1, const apr_sockaddr_t
*addr2) may avoid such. But I am not sure where to place that in current
modifications around addressttl.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 69126] addressttl strange behavior: checking address change before timeout, and closing connections while no change in name resolution
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69126
--- Comment #11 from Yann Ylavic <yl...@gmail.com> ---
Thanks for report and testing, checked in trunk's r1918410 and r1918412.
Will propose a backport to 2.4.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 69126] addressttl strange behavior: checking address change before timeout, and closing connections while no change in name resolution
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69126
Alexandre Schaff <al...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |alexandre.schaff@gmail.com
--- Comment #1 from Alexandre Schaff <al...@gmail.com> ---
Created attachment 39769
--> https://bz.apache.org/bugzilla/attachment.cgi?id=39769&action=edit
pcap with addressttl parameter not used.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org