membphis commented on a change in pull request #2339:
URL: https://github.com/apache/apisix/pull/2339#discussion_r496350317
##########
File path: bin/apisix
##########
@@ -192,6 +192,7 @@ http {
lua_shared_dict balancer_ewma 10m;
lua_shared_dict balancer_ewma_locks 10m;
lua_shared_dict balancer_ewma_last_touched_at 10m;
+ lua_shared_dict plugin-api-breaker 10m;
Review comment:
we need to copy this line to `t/APISIX.pm` for testing
##########
File path: apisix/plugins/api-breaker.lua
##########
@@ -0,0 +1,180 @@
+--
+-- 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 ngx = ngx
+local math = math
+local os = os
+local ipairs = ipairs
+local core = require("apisix.core")
+local plugin_name = "api-breaker"
+
+local shared_buffer = ngx.shared['plugin-'.. plugin_name]
+
+local schema = {
+ type = "object",
+ properties = {
+ response_code = {
+ type = "integer",
+ minimum = 200,
+ maximum = 599,
+ },
+ unhealthy = {
+ type = "object",
+ http_statuses = {
+ type = "array",
+ minItems = 1,
+ items = {
+ type = "integer",
+ minimum = 500,
+ maximum = 599,
+ },
+ uniqueItems = true,
+ default = {500}
Review comment:
why you say it not work? I do not found any test case about this default
value?
----------------------------------------------------------------
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:
[email protected]