You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/09/25 23:59:26 UTC

[GitHub] [apisix] membphis opened a new pull request #2322: Bug upstream parse lru

membphis opened a new pull request #2322:
URL: https://github.com/apache/apisix/pull/2322


   ### What this PR does / why we need it:
   <!--- Why is this change required? What problem does it solve? -->
   <!--- If it fixes an open issue, please link to the issue here. -->
   
   fix: https://github.com/apache/apisix/issues/2320
   
   ### Pre-submission checklist:
   
   * [ ] Did you explain what problem does this PR solve? Or what new features have been added?
   * [ ] Have you added corresponding test cases?
   * [ ] Have you modified the corresponding document?
   * [ ] Is this PR backward compatible?
   


----------------------------------------------------------------
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.

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



[GitHub] [apisix] moonming commented on pull request #2322: [WIP] bugfix: when service works with upstream that contains a domain name, the merged configuration should not always changing.

Posted by GitBox <gi...@apache.org>.
moonming commented on pull request #2322:
URL: https://github.com/apache/apisix/pull/2322#issuecomment-699581189


   ok


----------------------------------------------------------------
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.

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



[GitHub] [apisix] membphis commented on a change in pull request #2322: bugfix: when service works with upstream that contains a domain name, the merged configuration should not always changing.

Posted by GitBox <gi...@apache.org>.
membphis commented on a change in pull request #2322:
URL: https://github.com/apache/apisix/pull/2322#discussion_r495371676



##########
File path: apisix/init.lua
##########
@@ -461,23 +455,15 @@ function _M.http_access_phase()
 
     else
         if route.has_domain then
-            local parsed_route, err = lru_resolved_domain(route, api_ctx.conf_version,
-                                        return_direct, nil)
+            local err
+            route, err = lru_resolved_domain(route, api_ctx.conf_version,
+                            parse_domain_in_route, route, api_ctx)

Review comment:
       nice, will fix it later




----------------------------------------------------------------
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.

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



[GitHub] [apisix] spacewander merged pull request #2322: bugfix: when service works with upstream that contains a domain name, the merged configuration should not always changing.

Posted by GitBox <gi...@apache.org>.
spacewander merged pull request #2322:
URL: https://github.com/apache/apisix/pull/2322


   


----------------------------------------------------------------
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.

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



[GitHub] [apisix] gxthrj commented on a change in pull request #2322: bugfix: when service works with upstream that contains a domain name, the merged configuration should not always changing.

Posted by GitBox <gi...@apache.org>.
gxthrj commented on a change in pull request #2322:
URL: https://github.com/apache/apisix/pull/2322#discussion_r495362588



##########
File path: apisix/init.lua
##########
@@ -461,23 +455,15 @@ function _M.http_access_phase()
 
     else
         if route.has_domain then
-            local parsed_route, err = lru_resolved_domain(route, api_ctx.conf_version,
-                                        return_direct, nil)
+            local err
+            route, err = lru_resolved_domain(route, api_ctx.conf_version,
+                            parse_domain_in_route, route, api_ctx)

Review comment:
       `api_ctx` need to be removed ?




----------------------------------------------------------------
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.

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



[GitHub] [apisix] membphis commented on pull request #2322: [WIP] bugfix: when service works with upstream that contains a domain name, the merged configuration should not always changing.

Posted by GitBox <gi...@apache.org>.
membphis commented on pull request #2322:
URL: https://github.com/apache/apisix/pull/2322#issuecomment-699581094


   @moonming this is an old bug for long time, and it seems that I need more time to fix it. 
   Therefore, I think it is not necessary for the 2.0 milestone.


----------------------------------------------------------------
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.

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



[GitHub] [apisix] nic-chen commented on a change in pull request #2322: bugfix: when service works with upstream that contains a domain name, the merged configuration should not always changing.

Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #2322:
URL: https://github.com/apache/apisix/pull/2322#discussion_r495345598



##########
File path: t/plugin/key-auth-upstream-domain-node.t
##########
@@ -0,0 +1,155 @@
+#
+# 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.
+#
+use t::APISIX 'no_plan';
+
+repeat_each(1);
+no_long_string();
+no_root_location();
+no_shuffle();
+
+run_tests;
+
+__DATA__
+
+=== TEST 1: create consumer
+--- config
+    location /t {
+        content_by_lua_block {
+            local t = require("lib.test_admin").test
+            local code, body = t('/apisix/admin/consumers',
+                ngx.HTTP_PUT,
+                [[{
+                    "username": "jack",
+                    "plugins": {
+                        "key-auth": {
+                            "key": "auth-one"
+                        }
+                    }
+                }]]
+            )
+
+            ngx.say(body)
+        }
+    }
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 2: set service
+--- config
+    location /t {
+        content_by_lua_block {
+            local t = require("lib.test_admin").test
+            local code, body = t('/apisix/admin/services/1',
+                ngx.HTTP_PUT,
+                [[{
+                    "plugins": {
+                    },
+                    "desc": "new service"
+                }]]
+            )
+            ngx.say(body)
+        }
+    }
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 3: create route with plugin `limit-req`(upstream node contain domain)
+--- config
+    location /t {
+        content_by_lua_block {
+            local t = require("lib.test_admin").test
+            local code, body = t('/apisix/admin/routes/1',
+                ngx.HTTP_PUT,
+                [[{
+                    "plugins": {
+                        "limit-req": {
+                            "rate": 1,
+                            "burst": 0,
+                            "rejected_code": 503,
+                            "key": "remote_addr"
+                        }
+                    },
+                    "upstream": {
+                        "nodes": {
+                            "www.baidu.com:80": 1

Review comment:
       seems visit `baidu.com` unstable in github actions before? 




----------------------------------------------------------------
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.

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