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/10/15 09:40:54 UTC

[GitHub] [apisix] spacewander opened a new pull request #2430: WIP: fix: plugin hot reload should work on node

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


   ### 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:
   
   * [ ] 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] membphis commented on pull request #2430: fix: plugin hot reload should work on node

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


   that is a big feature, I'll take a look at this PR when I time ^_^
   
   many thx for your contribution @spacewander 


----------------------------------------------------------------
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 merged pull request #2430: fix: plugin hot reload should work on node

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


   


----------------------------------------------------------------
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 #2430: fix: plugin hot reload should work on node

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


   @spacewander many thx, merged already


----------------------------------------------------------------
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 #2430: fix: plugin hot reload should work on node

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



##########
File path: apisix/core/set.lua
##########
@@ -0,0 +1,40 @@
+--
+-- 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.
+--
+local nkeys        = require("table.nkeys")
+local pairs        = pairs
+
+
+local _M = {}
+
+
+-- Compare two tables as if they are sets (only compare the key part)
+function _M.eq(a, b)

Review comment:
       how about move the `eq` into `apisix.core.table`?

##########
File path: apisix/plugins/prometheus.lua
##########
@@ -29,7 +29,6 @@ local _M = {
     version = 0.2,
     priority = 500,
     name = plugin_name,
-    init = exporter.init,

Review comment:
       why do we need to delete this line? I think we need to keep it.

##########
File path: apisix/core/set.lua
##########
@@ -0,0 +1,40 @@
+--
+-- 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.
+--
+local nkeys        = require("table.nkeys")
+local pairs        = pairs
+
+
+local _M = {}
+
+
+-- Compare two tables as if they are sets (only compare the key part)
+function _M.eq(a, b)

Review comment:
       if yes, we need a better function name.

##########
File path: apisix/plugins/prometheus.lua
##########
@@ -29,7 +29,6 @@ local _M = {
     version = 0.2,
     priority = 500,
     name = plugin_name,
-    init = exporter.init,

Review comment:
       why do we need to delete this line? I think we need to keep it.

##########
File path: apisix/plugins/prometheus.lua
##########
@@ -29,7 +29,6 @@ local _M = {
     version = 0.2,
     priority = 500,
     name = plugin_name,
-    init = exporter.init,

Review comment:
       why do we need to delete this line? I think we need to keep it.

##########
File path: apisix/schema_def.lua
##########
@@ -665,6 +665,23 @@ _M.stream_route = {
 }
 
 
+_M.plugins = {
+    type = "array",
+    items = {
+        type = "object",
+        properties = {
+            name = {
+                type = "string"
+            },
+            stream = {
+                type = "boolean"
+            },
+        },
+        required = {"name"}

Review comment:
       add `additionalProperties = false`

##########
File path: apisix/schema_def.lua
##########
@@ -665,6 +665,23 @@ _M.stream_route = {
 }
 
 
+_M.plugins = {
+    type = "array",
+    items = {
+        type = "object",
+        properties = {
+            name = {
+                type = "string"

Review comment:
       need to limit the `max`, `min` length.




----------------------------------------------------------------
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 a change in pull request #2430: fix: plugin hot reload should work on node

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



##########
File path: apisix/plugins/prometheus.lua
##########
@@ -29,7 +29,6 @@ local _M = {
     version = 0.2,
     priority = 500,
     name = plugin_name,
-    init = exporter.init,

Review comment:
       @membphis 
   Because we don't call the prometheus init function when the plugin reload anymore.




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