You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2021/11/01 21:07:40 UTC

[GitHub] [trafficserver] serrislew opened a new pull request #8484: Serve stale content when DNS lookup fails

serrislew opened a new pull request #8484:
URL: https://github.com/apache/trafficserver/pull/8484


   Proxies should serve stale content even if DNS lookup to OS is unsuccessful. 
   - For hierarchical caching, if a child proxy matches successfully to a parent proxy and child has requested stale object in its cache, it should not need to make a DNS request for the origin.
      - It can validate with the parent and return the object as expected. 
   - Without hierarchical caching, if stale content is being requested from a proxy and the DNS lookup to the OS is unsuccessful, it should also serve the stale object
      - this behavior is similar to when the origin server is down and the proxy serves stale content with a warning header
   
   These changes still respect the `max_stale_age` configurations and do not serve stale content pass the expiration date.
   
   Autest tests the following using PUSH command to store stale content in proxy's cache: 
   - With child mapping to an origin server without a DNS entry and child matching successfully to parent, a request from child after content becomes stale returns `200`
      - After `max_stale_age` has passed, request from child returns `500` as stale content is no longer returnable
   - Without hierarchical caching and proxy mapping to an origin server without a DNS entry, a request from proxy after content becomes stale returns `200`
      - After `max_stale_age` has passed, request from proxy returns `500` as stale content is no longer returnable


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] ywkaras commented on a change in pull request #8484: Serve stale content when DNS lookup fails

Posted by GitBox <gi...@apache.org>.
ywkaras commented on a change in pull request #8484:
URL: https://github.com/apache/trafficserver/pull/8484#discussion_r769154336



##########
File path: tests/gold_tests/proxy_protocol/proxy_serve_stale_dns_fail.test.py
##########
@@ -0,0 +1,79 @@
+'''
+Test proxy serving stale content when DNS lookup fails
+'''
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+Test.ContinueOnFail = True
+# Set up hierarchical caching processes
+ts_child = Test.MakeATSProcess("ts_child")
+ts_parent = Test.MakeATSProcess("ts_parent")
+server_name = "http://unknown.domain.com/"
+
+Test.testName = "STALE"
+
+# Config child proxy to route to parent proxy
+ts_child.Disk.records_config.update({
+    'proxy.config.url_remap.pristine_host_hdr': 1,
+    'proxy.config.http.cache.max_stale_age': 10,
+    'proxy.config.http.parent_proxy.self_detect': 0,
+})
+ts_child.Disk.parent_config.AddLine(
+    f'dest_domain=. parent=localhost:{ts_parent.Variables.port} round_robin=consistent_hash go_direct=false'
+)
+ts_child.Disk.remap_config.AddLine(
+    f'map http://localhost:{ts_child.Variables.port} {server_name}'
+)
+
+# Configure parent proxy
+ts_parent.Disk.records_config.update({
+    'proxy.config.url_remap.pristine_host_hdr': 1,
+    'proxy.config.http.cache.max_stale_age': 10,
+})
+ts_parent.Disk.remap_config.AddLine(
+    f'map http://localhost:{ts_parent.Variables.port} {server_name}'
+)
+ts_parent.Disk.remap_config.AddLine(
+    f'map {server_name} {server_name}'

Review comment:
       Alternatively you can also do:  https://github.com/apache/trafficserver/blob/57749218b297849e26a00ba80ed0f26358190929/tests/gold_tests/pluginTest/test_hooks/test_hooks.test.py#L50
   
   But the way you have it is fine.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] ywkaras commented on a change in pull request #8484: Serve stale content when DNS lookup fails

Posted by GitBox <gi...@apache.org>.
ywkaras commented on a change in pull request #8484:
URL: https://github.com/apache/trafficserver/pull/8484#discussion_r753485694



##########
File path: tests/gold_tests/proxy_protocol/proxy_serve_stale_dns_fail.test.py
##########
@@ -0,0 +1,79 @@
+'''
+Test proxy serving stale content when DNS lookup fails
+'''
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+Test.ContinueOnFail = True
+# Set up hierarchical caching processes
+ts_child = Test.MakeATSProcess("ts_child")
+ts_parent = Test.MakeATSProcess("ts_parent")
+server_name = "http://unknown.domain.com/"
+
+Test.testName = "STALE"
+
+# Config child proxy to route to parent proxy
+ts_child.Disk.records_config.update({
+    'proxy.config.url_remap.pristine_host_hdr': 1,
+    'proxy.config.http.cache.max_stale_age': 30,
+    'proxy.config.http.parent_proxy.self_detect': 0,
+})
+ts_child.Disk.parent_config.AddLine(
+    f'dest_domain=. parent=localhost:{ts_parent.Variables.port} round_robin=consistent_hash go_direct=false'
+)
+ts_child.Disk.remap_config.AddLine(
+    f'map http://localhost:{ts_child.Variables.port} {server_name}'
+)
+
+# Configure parent proxy
+ts_parent.Disk.records_config.update({
+    'proxy.config.url_remap.pristine_host_hdr': 1,
+    'proxy.config.http.cache.max_stale_age': 30,
+})
+ts_parent.Disk.remap_config.AddLine(
+    f'map http://localhost:{ts_parent.Variables.port} {server_name}'
+)
+ts_parent.Disk.remap_config.AddLine(
+    f'map {server_name} {server_name}'
+)
+
+# Object to push to proxies
+stale_5 = "HTTP/1.1 200 OK\nServer: ATS/10.0.0\nAccept-Ranges: bytes\nContent-Length: 6\nCache-Control: public, max-age=5\n\nCACHED"
+stale_30 = "HTTP/1.1 200 OK\nServer: ATS/10.0.0\nAccept-Ranges: bytes\nContent-Length: 6\nCache-Control: public, max-age=30\n\nCACHED"

Review comment:
       Could this be changed to max-age=10 (or other value less than 30)?  @zwoop may only give you a fruit cake for X-mas if you make Au regression test runs take 30 seconds longer.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] ywkaras commented on a change in pull request #8484: Serve stale content when DNS lookup fails

Posted by GitBox <gi...@apache.org>.
ywkaras commented on a change in pull request #8484:
URL: https://github.com/apache/trafficserver/pull/8484#discussion_r769159771



##########
File path: tests/gold_tests/proxy_protocol/proxy_serve_stale_dns_fail.test.py
##########
@@ -0,0 +1,79 @@
+'''
+Test proxy serving stale content when DNS lookup fails
+'''
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+Test.ContinueOnFail = True
+# Set up hierarchical caching processes
+ts_child = Test.MakeATSProcess("ts_child")
+ts_parent = Test.MakeATSProcess("ts_parent")
+server_name = "http://unknown.domain.com/"
+
+Test.testName = "STALE"
+
+# Config child proxy to route to parent proxy
+ts_child.Disk.records_config.update({
+    'proxy.config.url_remap.pristine_host_hdr': 1,
+    'proxy.config.http.cache.max_stale_age': 10,
+    'proxy.config.http.parent_proxy.self_detect': 0,
+})
+ts_child.Disk.parent_config.AddLine(
+    f'dest_domain=. parent=localhost:{ts_parent.Variables.port} round_robin=consistent_hash go_direct=false'

Review comment:
       I don't understand why ATS would do a DNS lookup on the request host when it's not using the request host as the next hop.  But I suppose that's beyond the scope of this PR.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] serrislew commented on a change in pull request #8484: Serve stale content when DNS lookup fails

Posted by GitBox <gi...@apache.org>.
serrislew commented on a change in pull request #8484:
URL: https://github.com/apache/trafficserver/pull/8484#discussion_r769103122



##########
File path: tests/gold_tests/proxy_protocol/proxy_serve_stale_dns_fail.test.py
##########
@@ -0,0 +1,79 @@
+'''
+Test proxy serving stale content when DNS lookup fails
+'''
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+Test.ContinueOnFail = True
+# Set up hierarchical caching processes
+ts_child = Test.MakeATSProcess("ts_child")
+ts_parent = Test.MakeATSProcess("ts_parent")
+server_name = "http://unknown.domain.com/"
+
+Test.testName = "STALE"
+
+# Config child proxy to route to parent proxy
+ts_child.Disk.records_config.update({
+    'proxy.config.url_remap.pristine_host_hdr': 1,
+    'proxy.config.http.cache.max_stale_age': 10,
+    'proxy.config.http.parent_proxy.self_detect': 0,
+})
+ts_child.Disk.parent_config.AddLine(
+    f'dest_domain=. parent=localhost:{ts_parent.Variables.port} round_robin=consistent_hash go_direct=false'

Review comment:
       The http debug trace output shows the child doing PPDNS lookup to the parent and the parent doing a DNS lookup to unknown.domain.com (OS). After the DNS lookup fails for the parent but the parent has the stale returnable object in its cache, the child will revalidate from the parent (without doing a DNS lookup) and return the object to the client. Let me know if you are seeing something different in the debug trace output!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] serrislew commented on a change in pull request #8484: Serve stale content when DNS lookup fails

Posted by GitBox <gi...@apache.org>.
serrislew commented on a change in pull request #8484:
URL: https://github.com/apache/trafficserver/pull/8484#discussion_r769103122



##########
File path: tests/gold_tests/proxy_protocol/proxy_serve_stale_dns_fail.test.py
##########
@@ -0,0 +1,79 @@
+'''
+Test proxy serving stale content when DNS lookup fails
+'''
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+Test.ContinueOnFail = True
+# Set up hierarchical caching processes
+ts_child = Test.MakeATSProcess("ts_child")
+ts_parent = Test.MakeATSProcess("ts_parent")
+server_name = "http://unknown.domain.com/"
+
+Test.testName = "STALE"
+
+# Config child proxy to route to parent proxy
+ts_child.Disk.records_config.update({
+    'proxy.config.url_remap.pristine_host_hdr': 1,
+    'proxy.config.http.cache.max_stale_age': 10,
+    'proxy.config.http.parent_proxy.self_detect': 0,
+})
+ts_child.Disk.parent_config.AddLine(
+    f'dest_domain=. parent=localhost:{ts_parent.Variables.port} round_robin=consistent_hash go_direct=false'

Review comment:
       The http debug trace output shows the child doing PPDNS lookup to the parent and the parent doing a DNS lookup to unknown.domain.com (OS). After the DNS lookup fails for the parent and the parent sends a 500 response to the child, the child will first check if the stale object is returnable before sending it back to the client. Let me know if you are seeing something different in the debug trace output!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] ywkaras commented on a change in pull request #8484: Serve stale content when DNS lookup fails

Posted by GitBox <gi...@apache.org>.
ywkaras commented on a change in pull request #8484:
URL: https://github.com/apache/trafficserver/pull/8484#discussion_r767014565



##########
File path: tests/gold_tests/proxy_protocol/proxy_serve_stale_dns_fail.test.py
##########
@@ -0,0 +1,79 @@
+'''
+Test proxy serving stale content when DNS lookup fails
+'''
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+Test.ContinueOnFail = True
+# Set up hierarchical caching processes
+ts_child = Test.MakeATSProcess("ts_child")
+ts_parent = Test.MakeATSProcess("ts_parent")
+server_name = "http://unknown.domain.com/"
+
+Test.testName = "STALE"
+
+# Config child proxy to route to parent proxy
+ts_child.Disk.records_config.update({
+    'proxy.config.url_remap.pristine_host_hdr': 1,
+    'proxy.config.http.cache.max_stale_age': 10,
+    'proxy.config.http.parent_proxy.self_detect': 0,
+})
+ts_child.Disk.parent_config.AddLine(
+    f'dest_domain=. parent=localhost:{ts_parent.Variables.port} round_robin=consistent_hash go_direct=false'
+)
+ts_child.Disk.remap_config.AddLine(
+    f'map http://localhost:{ts_child.Variables.port} {server_name}'
+)
+
+# Configure parent proxy
+ts_parent.Disk.records_config.update({
+    'proxy.config.url_remap.pristine_host_hdr': 1,
+    'proxy.config.http.cache.max_stale_age': 10,
+})
+ts_parent.Disk.remap_config.AddLine(
+    f'map http://localhost:{ts_parent.Variables.port} {server_name}'
+)
+ts_parent.Disk.remap_config.AddLine(
+    f'map {server_name} {server_name}'

Review comment:
       Why do you need this?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] serrislew commented on a change in pull request #8484: Serve stale content when DNS lookup fails

Posted by GitBox <gi...@apache.org>.
serrislew commented on a change in pull request #8484:
URL: https://github.com/apache/trafficserver/pull/8484#discussion_r769102747



##########
File path: tests/gold_tests/proxy_protocol/proxy_serve_stale_dns_fail.test.py
##########
@@ -0,0 +1,79 @@
+'''
+Test proxy serving stale content when DNS lookup fails
+'''
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+Test.ContinueOnFail = True
+# Set up hierarchical caching processes
+ts_child = Test.MakeATSProcess("ts_child")
+ts_parent = Test.MakeATSProcess("ts_parent")
+server_name = "http://unknown.domain.com/"
+
+Test.testName = "STALE"
+
+# Config child proxy to route to parent proxy
+ts_child.Disk.records_config.update({
+    'proxy.config.url_remap.pristine_host_hdr': 1,
+    'proxy.config.http.cache.max_stale_age': 10,
+    'proxy.config.http.parent_proxy.self_detect': 0,
+})
+ts_child.Disk.parent_config.AddLine(
+    f'dest_domain=. parent=localhost:{ts_parent.Variables.port} round_robin=consistent_hash go_direct=false'
+)
+ts_child.Disk.remap_config.AddLine(
+    f'map http://localhost:{ts_child.Variables.port} {server_name}'
+)
+
+# Configure parent proxy
+ts_parent.Disk.records_config.update({
+    'proxy.config.url_remap.pristine_host_hdr': 1,
+    'proxy.config.http.cache.max_stale_age': 10,
+})
+ts_parent.Disk.remap_config.AddLine(
+    f'map http://localhost:{ts_parent.Variables.port} {server_name}'
+)
+ts_parent.Disk.remap_config.AddLine(
+    f'map {server_name} {server_name}'

Review comment:
       I am testing for non-hierarchical scenarios as well so the `ts_parent` server is mapped to the OS and gets called directly




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] ywkaras commented on a change in pull request #8484: Serve stale content when DNS lookup fails

Posted by GitBox <gi...@apache.org>.
ywkaras commented on a change in pull request #8484:
URL: https://github.com/apache/trafficserver/pull/8484#discussion_r769133617



##########
File path: tests/gold_tests/proxy_protocol/proxy_serve_stale_dns_fail.test.py
##########
@@ -0,0 +1,79 @@
+'''
+Test proxy serving stale content when DNS lookup fails
+'''
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+Test.ContinueOnFail = True
+# Set up hierarchical caching processes
+ts_child = Test.MakeATSProcess("ts_child")
+ts_parent = Test.MakeATSProcess("ts_parent")
+server_name = "http://unknown.domain.com/"
+
+Test.testName = "STALE"

Review comment:
       Most of our Au tests don't assigned testName, I'm not sure what it's for:
   ```
   wkaras ~/REPOS/TS3/tests/gold_tests
   M$ find . -name \*.test.py | wc -l
        239
   wkaras ~/REPOS/TS3/tests/gold_tests
   M$ fgrep Test.testName $( find . -name \*.test.py ) | wc -l
         44
   wkaras ~/REPOS/TS3/tests/gold_tests
   M$
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] ywkaras commented on a change in pull request #8484: Serve stale content when DNS lookup fails

Posted by GitBox <gi...@apache.org>.
ywkaras commented on a change in pull request #8484:
URL: https://github.com/apache/trafficserver/pull/8484#discussion_r767014565



##########
File path: tests/gold_tests/proxy_protocol/proxy_serve_stale_dns_fail.test.py
##########
@@ -0,0 +1,79 @@
+'''
+Test proxy serving stale content when DNS lookup fails
+'''
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+Test.ContinueOnFail = True
+# Set up hierarchical caching processes
+ts_child = Test.MakeATSProcess("ts_child")
+ts_parent = Test.MakeATSProcess("ts_parent")
+server_name = "http://unknown.domain.com/"
+
+Test.testName = "STALE"
+
+# Config child proxy to route to parent proxy
+ts_child.Disk.records_config.update({
+    'proxy.config.url_remap.pristine_host_hdr': 1,
+    'proxy.config.http.cache.max_stale_age': 10,
+    'proxy.config.http.parent_proxy.self_detect': 0,
+})
+ts_child.Disk.parent_config.AddLine(
+    f'dest_domain=. parent=localhost:{ts_parent.Variables.port} round_robin=consistent_hash go_direct=false'
+)
+ts_child.Disk.remap_config.AddLine(
+    f'map http://localhost:{ts_child.Variables.port} {server_name}'
+)
+
+# Configure parent proxy
+ts_parent.Disk.records_config.update({
+    'proxy.config.url_remap.pristine_host_hdr': 1,
+    'proxy.config.http.cache.max_stale_age': 10,
+})
+ts_parent.Disk.remap_config.AddLine(
+    f'map http://localhost:{ts_parent.Variables.port} {server_name}'
+)
+ts_parent.Disk.remap_config.AddLine(
+    f'map {server_name} {server_name}'

Review comment:
       Why do you need this?

##########
File path: tests/gold_tests/proxy_protocol/proxy_serve_stale_dns_fail.test.py
##########
@@ -0,0 +1,79 @@
+'''
+Test proxy serving stale content when DNS lookup fails
+'''
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+Test.ContinueOnFail = True
+# Set up hierarchical caching processes
+ts_child = Test.MakeATSProcess("ts_child")
+ts_parent = Test.MakeATSProcess("ts_parent")
+server_name = "http://unknown.domain.com/"
+
+Test.testName = "STALE"
+
+# Config child proxy to route to parent proxy
+ts_child.Disk.records_config.update({
+    'proxy.config.url_remap.pristine_host_hdr': 1,
+    'proxy.config.http.cache.max_stale_age': 10,
+    'proxy.config.http.parent_proxy.self_detect': 0,
+})
+ts_child.Disk.parent_config.AddLine(
+    f'dest_domain=. parent=localhost:{ts_parent.Variables.port} round_robin=consistent_hash go_direct=false'

Review comment:
       So even with this configured, child TS will still do a DNS lookup on unkown.domain.com ?  Did you see the DNS lookup in the http debug trace output?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] ywkaras commented on a change in pull request #8484: Serve stale content when DNS lookup fails

Posted by GitBox <gi...@apache.org>.
ywkaras commented on a change in pull request #8484:
URL: https://github.com/apache/trafficserver/pull/8484#discussion_r767059232



##########
File path: tests/gold_tests/proxy_protocol/proxy_serve_stale_dns_fail.test.py
##########
@@ -0,0 +1,79 @@
+'''
+Test proxy serving stale content when DNS lookup fails
+'''
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+Test.ContinueOnFail = True
+# Set up hierarchical caching processes
+ts_child = Test.MakeATSProcess("ts_child")
+ts_parent = Test.MakeATSProcess("ts_parent")
+server_name = "http://unknown.domain.com/"
+
+Test.testName = "STALE"
+
+# Config child proxy to route to parent proxy
+ts_child.Disk.records_config.update({
+    'proxy.config.url_remap.pristine_host_hdr': 1,
+    'proxy.config.http.cache.max_stale_age': 10,
+    'proxy.config.http.parent_proxy.self_detect': 0,
+})
+ts_child.Disk.parent_config.AddLine(
+    f'dest_domain=. parent=localhost:{ts_parent.Variables.port} round_robin=consistent_hash go_direct=false'

Review comment:
       So even with this configured, child TS will still do a DNS lookup on unkown.domain.com ?  Did you see the DNS lookup in the http debug trace output?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] ywkaras commented on a change in pull request #8484: Serve stale content when DNS lookup fails

Posted by GitBox <gi...@apache.org>.
ywkaras commented on a change in pull request #8484:
URL: https://github.com/apache/trafficserver/pull/8484#discussion_r769137522



##########
File path: tests/gold_tests/proxy_protocol/proxy_serve_stale_dns_fail.test.py
##########
@@ -0,0 +1,79 @@
+'''
+Test proxy serving stale content when DNS lookup fails
+'''
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+Test.ContinueOnFail = True
+# Set up hierarchical caching processes
+ts_child = Test.MakeATSProcess("ts_child")
+ts_parent = Test.MakeATSProcess("ts_parent")
+server_name = "http://unknown.domain.com/"
+
+Test.testName = "STALE"
+
+# Config child proxy to route to parent proxy
+ts_child.Disk.records_config.update({
+    'proxy.config.url_remap.pristine_host_hdr': 1,
+    'proxy.config.http.cache.max_stale_age': 10,
+    'proxy.config.http.parent_proxy.self_detect': 0,
+})
+ts_child.Disk.parent_config.AddLine(
+    f'dest_domain=. parent=localhost:{ts_parent.Variables.port} round_robin=consistent_hash go_direct=false'

Review comment:
       Lately we've been including DNS servers in our Au tests:  https://github.com/apache/trafficserver/blob/57749218b297849e26a00ba80ed0f26358190929/tests/gold_tests/next_hop/strategies_ch/strategies_ch.test.py#L71




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] ywkaras commented on pull request #8484: Serve stale content when DNS lookup fails

Posted by GitBox <gi...@apache.org>.
ywkaras commented on pull request #8484:
URL: https://github.com/apache/trafficserver/pull/8484#issuecomment-1004467783


   We discussed this in today's meeting, it turns out microdns is trickier to use than I thought, and not well-documented, so approving this as is.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] vmamidi merged pull request #8484: Serve stale content when DNS lookup fails

Posted by GitBox <gi...@apache.org>.
vmamidi merged pull request #8484:
URL: https://github.com/apache/trafficserver/pull/8484


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] ywkaras commented on pull request #8484: Serve stale content when DNS lookup fails

Posted by GitBox <gi...@apache.org>.
ywkaras commented on pull request #8484:
URL: https://github.com/apache/trafficserver/pull/8484#issuecomment-991338008


   I forget now, did you say Apple is already running this on production proxies?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] ywkaras commented on pull request #8484: Serve stale content when DNS lookup fails

Posted by GitBox <gi...@apache.org>.
ywkaras commented on pull request #8484:
URL: https://github.com/apache/trafficserver/pull/8484#issuecomment-991338008


   I forget now, did you say Apple is already running this on production proxies?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org