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/12/23 07:23:06 UTC

[GitHub] [apisix] arabot777 opened a new pull request #5897: Discussions no5833

arabot777 opened a new pull request #5897:
URL: https://github.com/apache/apisix/pull/5897


   ### 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. -->
   Add degradation switch for  ext-plugin.
   https://github.com/apache/apisix/discussions/5833
   ### Pre-submission checklist:
   
   <!--
   Please follow the requirements:
   1. Use Draft if the PR is not ready to be reviewed
   2. Test is required for the feat/fix PR, unless you have a good reason
   3. Doc is required for the feat PR
   4. Use a new commit to resolve review instead of `push -f`
   5. If you need to resolve merge conflicts after the PR is reviewed, please merge master but do not rebase
   6. Use "request review" to notify the reviewer once you have resolved the review
   -->
   
   * [x] Did you explain what problem does this PR solve? Or what new features have been added?
   * [x] Have you added corresponding test cases?
   * [x] Have you modified the corresponding document?
   * [x] 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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] tokers commented on a change in pull request #5897: feat(plugin): add degradation switch for ext-plugin

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



##########
File path: apisix/plugins/ext-plugin/init.lua
##########
@@ -700,6 +701,9 @@ function _M.communicate(conf, ctx, plugin_name)
 
         if not core.string.find(err, "conf token not found") then
             core.log.error(err)
+            if conf.allow_degradation then
+                return

Review comment:
       Let's add a logging message here? So we can detect the degradation situation, also, we can enrich our test cases.




-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] tzssangglass commented on a change in pull request #5897: feat(plugin): add degradation switch for ext-plugin

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



##########
File path: docs/zh/latest/plugins/ext-plugin-pre-req.md
##########
@@ -42,6 +42,7 @@ External Plugins 执行的结果会影响当前请求的行为。
 | 名称      | 类型          | 必选项 | 默认值    | 有效值                                                                    | 描述                                                                                                                                         |
 | --------- | ------------- | ----------- | ---------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
 | conf     | array        | 可选    |              | [{"name": "ext-plugin-A", "value": "{\"enable\":\"feature\"}"}] |     在 Plugin Runner 内执行的插件列表的配置 |
+| allow_degradation              | boolean  | 可选                                | false       |                                                                     | 当插件功能临时不可用时是否允许请求继续。当值设置为 true 时则自动允许请求继续,默认值是 false。|

Review comment:
       ```suggestion
   | allow_degradation              | boolean  | 可选                                | false       |                                                                     | 当 Plugin Runner 临时不可用时是否允许请求继续。当值设置为 true 时则自动允许请求继续,默认值是 false。|
   ```




-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] spacewander commented on pull request #5897: feat(plugin): add degradation switch for ext-plugin

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


   @tokers 
   Can we merge this PR now?


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] arabot777 commented on a change in pull request #5897: feat(plugin): add degradation switch for ext-plugin

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



##########
File path: apisix/plugins/ext-plugin/init.lua
##########
@@ -700,6 +701,9 @@ function _M.communicate(conf, ctx, plugin_name)
 
         if not core.string.find(err, "conf token not found") then
             core.log.error(err)
+            if conf.allow_degradation then
+                return

Review comment:
       have changed




-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] spacewander commented on a change in pull request #5897: feat(plugin): add degradation switch for ext-plugin

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



##########
File path: docs/en/latest/plugins/ext-plugin-pre-req.md
##########
@@ -43,6 +43,7 @@ The result of external plugins execution will affect the behavior of the current
 | Name      | Type          | Requirement | Default    | Valid                                                                    | Description                                                                                                                                         |
 | --------- | ------------- | ----------- | ---------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
 | conf     | array        | optional    |              | [{"name": "ext-plugin-A", "value": "{\"enable\":\"feature\"}"}] |     The plugins list which will be executed at the plugin runner with their configuration    |
+| allow_degradation              | boolean  | optional                                | false       |                                                                     | Whether to enable plugin degradation when the ext-plugin-pre-req function is temporarily unavailable. Allow requests to continue when the value is set to true, default false. |

Review comment:
       ```suggestion
   | allow_degradation              | boolean  | optional                                | false       |                                                                     | Whether to enable plugin degradation when the plugin runner is temporarily unavailable. Allow requests to continue when the value is set to true, default false. |
   ```




-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] spacewander merged pull request #5897: feat(plugin): add degradation switch for ext-plugin

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


   


-- 
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: notifications-unsubscribe@apisix.apache.org

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