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 2021/05/07 01:58:56 UTC

[GitHub] [apisix] spacewander opened a new pull request #4192: fix: use original modifiedIndex if possible

spacewander opened a new pull request #4192:
URL: https://github.com/apache/apisix/pull/4192


   Fix #4160
   
   Signed-off-by: spacewander <sp...@gmail.com>
   
   ### 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. -->
   
   ### Pre-submission checklist:
   
   * [x] Did you explain what problem does this PR solve? Or what new features have been added?
   * [x] Have you added corresponding test cases?
   * [ ] Have you modified the corresponding document?
   * [ ] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix/tree/master#community) first**
   


-- 
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] Yiyiyimu commented on a change in pull request #4192: fix: use original modifiedIndex if possible

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



##########
File path: t/plugin/prometheus3.t
##########
@@ -0,0 +1,94 @@
+#
+# 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.
+#
+BEGIN {
+    if ($ENV{TEST_NGINX_CHECK_LEAK}) {
+        $SkipReason = "unavailable for the hup tests";
+
+    } else {
+        $ENV{TEST_NGINX_USE_HUP} = 1;
+        undef $ENV{TEST_NGINX_USE_STAP};
+    }
+}
+
+use t::APISIX 'no_plan';
+
+repeat_each(1);
+no_long_string();
+no_shuffle();
+no_root_location();
+run_tests;
+
+__DATA__
+
+=== TEST 1: use original etcd modified index
+--- config
+    location /t {
+        content_by_lua_block {
+            local t = require("lib.test_admin").test
+            local code, body = t('/apisix/admin/plugin_configs/1',
+                ngx.HTTP_PUT,
+                [[{
+                    "plugins": {
+                        "prometheus":{}
+                    }
+                }]]
+                )
+
+            if code >= 300 then
+                ngx.status = code
+                ngx.say(body)
+                return
+            end
+
+            local code, body = t('/apisix/admin/routes/1',
+                ngx.HTTP_PUT,
+                [[{
+                    "plugin_config_id": 1,
+                    "plugins": {

Review comment:
       maybe could remove `plugins` here




-- 
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] Yiyiyimu commented on pull request #4192: fix: use original modifiedIndex if possible

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


   I test dozens of times with the reproduce steps from @tzssangglass and also this new test on master branch, and both of them passed without errors. Is there any specific reason to cause this problem, since it seems not always happen.
   
   And if it is triggered randomly, do we need to test it several times to ensure the error would not occur


-- 
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 commented on pull request #4192: fix: use original modifiedIndex if possible

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


   @Yiyiyimu 
   It can be simply reproduced with running my test without my fix.


-- 
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] tokers merged pull request #4192: fix: use original modifiedIndex if possible

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


   


-- 
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] Yiyiyimu commented on pull request #4192: fix: use original modifiedIndex if possible

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


   > @Yiyiyimu
   > It can be simply reproduced with running my test without my fix.
   
   Could reproduce for now. Can't find the reason yet maybe there is something configured wrong on my local environment..


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