[GitHub] [apisix] spacewander commented on pull request #2352: feat: add referer-restriction plugin

2020-10-05 Thread GitBox


spacewander commented on pull request #2352:
URL: https://github.com/apache/apisix/pull/2352#issuecomment-704057548


   @membphis 
   Done



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:
us...@infra.apache.org




[GitHub] [apisix] membphis closed issue #2330: request help: Apisix host configuration of route can not be '*' ?

2020-10-05 Thread GitBox


membphis closed issue #2330:
URL: https://github.com/apache/apisix/issues/2330


   



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:
us...@infra.apache.org




[GitHub] [apisix] xyz2b commented on issue #2330: request help: Apisix host configuration of route can not be '*' ?

2020-10-05 Thread GitBox


xyz2b commented on issue #2330:
URL: https://github.com/apache/apisix/issues/2330#issuecomment-704011141


   ok, thank you.



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:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on pull request #2270: feature: support `consumer_name` as key of `limit-req` plugin.

2020-10-05 Thread GitBox


membphis commented on pull request #2270:
URL: https://github.com/apache/apisix/pull/2270#issuecomment-704011196


   ping @moonming 



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:
us...@infra.apache.org




[GitHub] [apisix] membphis closed issue #2302: request help: failed to match any routes

2020-10-05 Thread GitBox


membphis closed issue #2302:
URL: https://github.com/apache/apisix/issues/2302


   



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:
us...@infra.apache.org




[GitHub] [apisix] membphis merged pull request #2304: fix: Update error message when Route doesn't exist

2020-10-05 Thread GitBox


membphis merged pull request #2304:
URL: https://github.com/apache/apisix/pull/2304


   



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:
us...@infra.apache.org




[apisix] branch master updated: fix: Update error message when Route doesn't exist (#2304)

2020-10-05 Thread membphis
This is an automated email from the ASF dual-hosted git repository.

membphis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 720d135  fix: Update error message when Route doesn't exist (#2304)
720d135 is described below

commit 720d135fd28677ae80a7922d959ba86e978df727
Author: L 
AuthorDate: Tue Oct 6 11:48:52 2020 +0800

fix: Update error message when Route doesn't exist (#2304)

Fixes #2302

Co-authored-by: YuanSheng Wang 
---
 apisix/init.lua  |  2 +-
 t/core/etcd.t| 10 +-
 t/debug/hook.t   |  2 +-
 t/node/filter_func.t |  2 +-
 t/node/global-rule.t |  4 ++--
 t/node/hosts.t   |  4 ++--
 t/node/invalid-route.t   |  2 +-
 t/node/invalid-service.t |  2 +-
 t/node/invalid-upstream.t|  2 +-
 t/node/merge-route.t |  2 +-
 t/node/not-exist-upstream.t  |  2 +-
 t/node/remote-addr-ipv6.t|  6 +++---
 t/node/remote-addr.t |  4 ++--
 t/node/remote_addrs.t|  2 +-
 t/node/route-domain-with-local-dns.t |  2 +-
 t/node/route-domain.t|  2 +-
 t/node/route-filter-func.t   |  2 +-
 t/node/route-host.t  |  6 +++---
 t/node/route-parameter-uri.t | 10 +-
 t/node/sanity-radixtree.t|  4 ++--
 t/node/upstream-domain.t |  2 +-
 t/node/upstream-ipv6.t   |  2 +-
 t/node/upstream-retries.t|  2 +-
 t/node/upstream.t|  2 +-
 t/node/vars.t| 16 
 t/node/wildcard-host.t   |  4 ++--
 t/router/radixtree-host-uri.t| 10 +-
 t/router/radixtree-uri-host.t|  6 +++---
 t/router/radixtree-uri-multiple.t|  2 +-
 t/router/radixtree-uri-sanity.t  | 10 +-
 30 files changed, 64 insertions(+), 64 deletions(-)

diff --git a/apisix/init.lua b/apisix/init.lua
index cc7902b..3d9ffea 100644
--- a/apisix/init.lua
+++ b/apisix/init.lua
@@ -372,7 +372,7 @@ function _M.http_access_phase()
 local route = api_ctx.matched_route
 if not route then
 return core.response.exit(404,
-{error_msg = "failed to match any routes"})
+{error_msg = "404 Route Not Found"})
 end
 
 if route.value.service_protocol == "grpc" then
diff --git a/t/core/etcd.t b/t/core/etcd.t
index 197f7e9..7dc3a38 100644
--- a/t/core/etcd.t
+++ b/t/core/etcd.t
@@ -104,8 +104,8 @@ Host: foo.com
 --- error_code eval
 [201, 200, 200, 200, 200, 404, 201, 200, 200, 200, 200, 404]
 --- response_body eval
-["passed\n", "hello world\n", "passed\n", "hello world\n", "passed\n", 
"{\"error_msg\":\"failed to match any routes\"}\n",
-"passed\n", "hello world\n", "passed\n", "hello world\n", "passed\n", 
"{\"error_msg\":\"failed to match any routes\"}\n"]
+["passed\n", "hello world\n", "passed\n", "hello world\n", "passed\n", 
"{\"error_msg\":\"404 Route Not Found\"}\n",
+"passed\n", "hello world\n", "passed\n", "hello world\n", "passed\n", 
"{\"error_msg\":\"404 Route Not Found\"}\n"]
 --- no_error_log
 [error]
 --- timeout: 5
@@ -227,8 +227,8 @@ Host: foo.com
 --- error_code eval
 [201, 200, 200, 404, 200, 200, 404, 201, 200, 200, 404, 200, 200, 404]
 --- response_body eval
-["passed\n", "hello world\n", "passed\n", "{\"error_msg\":\"failed to match 
any routes\"}\n", "ok\n", "passed\n", "{\"error_msg\":\"failed to match any 
routes\"}\n",
-"passed\n", "hello world\n", "passed\n", "{\"error_msg\":\"failed to match any 
routes\"}\n", "hello1 world\n", "passed\n", "{\"error_msg\":\"failed to match 
any routes\"}\n"]
+["passed\n", "hello world\n", "passed\n", "{\"error_msg\":\"404 Route Not 
Found\"}\n", "ok\n", "passed\n", "{\"error_msg\":\"404 Route Not Found\"}\n",
+"passed\n", "hello world\n", "passed\n", "{\"error_msg\":\"404 Route Not 
Found\"}\n", "hello1 world\n", "passed\n", "{\"error_msg\":\"404 Route Not 
Found\"}\n"]
 --- no_error_log
 [error]
 --- timeout: 5
@@ -329,7 +329,7 @@ Host: foo.com
 --- error_code eval
 [201, 200, 201, 200, 200, 200, 200, 404]
 --- response_body eval
-["passed\n", "/print_uri_20\n", "passed\n", "/print_uri_36\n", "passed\n", 
"/print_uri_12\n", "passed\n", "{\"error_msg\":\"failed to match any 
routes\"}\n"]
+["passed\n", "/print_uri_20\n", "passed\n", "/print_uri_36\n", "passed\n", 
"/print_uri_12\n", "passed\n", "{\"error_msg\":\"404 Route Not Found\"}\n"]
 --- no_error_log
 [error]
 --- timeout: 20
diff --git a/t/debug/hook.t b/t/debug/hook.t
index 49bce20..5b64d3c 100644
--- a/t/debug/hook.t
+++ b/t/debug/hook.t
@@ -85,7 +85,7 @@ passed
 GET /not_found
 --- error_code: 404
 --- response_body
-{"error_msg":"failed to match any routes"}
+{"error_msg":"404 Route Not Found"}
 --- no_error_log
 [error]
 
diff --git a/t/node/filter_

[GitHub] [apisix] membphis commented on issue #2280: Route traffic through company proxy / firewall

2020-10-05 Thread GitBox


membphis commented on issue #2280:
URL: https://github.com/apache/apisix/issues/2280#issuecomment-704010247


   > You can achieve the same effect with 
[proxy-rewrite](https://github.com/apache/apisix/blob/master/doc/zh-cn/plugins/proxy-rewrite.md)
   
   can you show us an example of this case? if it can work, it should be 
helpful for @MrLightSpeed0 



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:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on issue #2318: request help: How to use circuit breaking service? Thanks

2020-10-05 Thread GitBox


membphis commented on issue #2318:
URL: https://github.com/apache/apisix/issues/2318#issuecomment-704009310


   > It seems that you have already realized "Circuit-Breaker : Intelligent 
tracking of unhealthy upstream services."
   
   you can enable the `health checker` in the upstream objects first. 
   it'll remove the unhealthy upstream node if the status is unhealthy.



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:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on issue #1226: feature: Support follow redirect

2020-10-05 Thread GitBox


membphis commented on issue #1226:
URL: https://github.com/apache/apisix/issues/1226#issuecomment-704008553


   @liuhengloveyou Do you know how to implement this feature?



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:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on issue #2315: request help: Nginx integrated skywalking acquisition function, TPS decreased significantly

2020-10-05 Thread GitBox


membphis commented on issue #2315:
URL: https://github.com/apache/apisix/issues/2315#issuecomment-704008121


   > Probably because the collection logic increases the request time. 
@liuhengloveyou 
   
   We need to confirm what is causing the increase in request time.



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:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on issue #2291: feature: Create RabbitMQ publisher plugin

2020-10-05 Thread GitBox


membphis commented on issue #2291:
URL: https://github.com/apache/apisix/issues/2291#issuecomment-704007500


   https://github.com/wingify/lua-resty-rabbitmqstomp
   
   this library seems good, it is `MIT` license.



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:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on issue #2314: request help: how to renew healthy-checke lrucache

2020-10-05 Thread GitBox


membphis commented on issue #2314:
URL: https://github.com/apache/apisix/issues/2314#issuecomment-704003733


   > when the registry information changes, lrucache_checker cannot detect and 
update the cache, 
   
   if the registration information changes, the old lrucache_checker will be 
removed automatically. here is the source code line:
   
   https://github.com/apache/apisix/blob/master/apisix/core/config_etcd.lua#L196
   
   if the old lrucache_checker was not removed automatically when the 
registration information changes, it should be a bug.



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:
us...@infra.apache.org




[GitHub] [apisix-dashboard] moonming commented on pull request #535: feat: refactor apis for existing check and other apis

2020-10-05 Thread GitBox


moonming commented on pull request #535:
URL: https://github.com/apache/apisix-dashboard/pull/535#issuecomment-703966592


   Please add codecov 



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:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on issue #297: feature(https): support for creating new SSL objects using certificate files.

2020-10-05 Thread GitBox


membphis commented on issue #297:
URL: https://github.com/apache/apisix/issues/297#issuecomment-703701518


   here is a usage:
   
   ```
   curl -X POST  -F cert=@test.crt -F key=@test.key -F sni="test.com"  
http://myapi.com/admin/ssl/1
   ```
   
   it is easier to use for the user.



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:
us...@infra.apache.org




[GitHub] [apisix] membphis merged pull request #2350: feat: also call picker.after_balance before retry

2020-10-05 Thread GitBox


membphis merged pull request #2350:
URL: https://github.com/apache/apisix/pull/2350


   



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:
us...@infra.apache.org




[apisix] branch master updated: feat: also call picker.after_balance before retry (#2350)

2020-10-05 Thread membphis
This is an automated email from the ASF dual-hosted git repository.

membphis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 16a2d4d  feat: also call picker.after_balance before retry (#2350)
16a2d4d is described below

commit 16a2d4dfa97a8b10cf37936aed8c0173b374d4a4
Author: 罗泽轩 
AuthorDate: Mon Oct 5 23:19:40 2020 +0800

feat: also call picker.after_balance before retry (#2350)
---
 apisix/balancer.lua  | 4 
 apisix/balancer/ewma.lua | 7 ++-
 apisix/init.lua  | 2 +-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/apisix/balancer.lua b/apisix/balancer.lua
index cfe53b9..f2eec90 100644
--- a/apisix/balancer.lua
+++ b/apisix/balancer.lua
@@ -172,6 +172,10 @@ local function pick_server(route, ctx)
 return nil, "no valid upstream node"
 end
 
+if ctx.server_picker and ctx.server_picker.after_balance then
+ctx.server_picker.after_balance(ctx, true)
+end
+
 if up_conf.timeout then
 local timeout = up_conf.timeout
 local ok, err = set_timeouts(timeout.connect, timeout.send,
diff --git a/apisix/balancer/ewma.lua b/apisix/balancer/ewma.lua
index 5198c28..bdc7722 100644
--- a/apisix/balancer/ewma.lua
+++ b/apisix/balancer/ewma.lua
@@ -146,7 +146,12 @@ local function _ewma_find(ctx, up_nodes)
 end
 
 
-local function _ewma_after_balance(ctx)
+local function _ewma_after_balance(ctx, before_retry)
+if before_retry then
+-- don't count tries which fail to complete
+return nil
+end
+
 local response_time = tonumber(ctx.var.upstream_response_time) or 0
 local connect_time = tonumber(ctx.var.upstream_connect_time) or 0
 local rtt = connect_time + response_time
diff --git a/apisix/init.lua b/apisix/init.lua
index 780757f..cc7902b 100644
--- a/apisix/init.lua
+++ b/apisix/init.lua
@@ -672,7 +672,7 @@ function _M.http_log_phase()
 healcheck_passive(api_ctx)
 
 if api_ctx.server_picker and api_ctx.server_picker.after_balance then
-api_ctx.server_picker.after_balance(api_ctx)
+api_ctx.server_picker.after_balance(api_ctx, false)
 end
 
 if api_ctx.uri_parse_param then



[GitHub] [apisix] membphis commented on issue #1774: optimize: fetch the request method name with integer data type

2020-10-05 Thread GitBox


membphis commented on issue #1774:
URL: https://github.com/apache/apisix/issues/1774#issuecomment-703698273


   > What is it now?
   
   your question makes me confused. 
   
   In APISIX, we mainly use `ngx.req.get_method()` now.
   
   But I think we can use `ngx_http_lua_ffi_req_get_method` which it is better 
performance.



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:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on issue #638: feature: supported cluster limit-req with redis server.

2020-10-05 Thread GitBox


membphis commented on issue #638:
URL: https://github.com/apache/apisix/issues/638#issuecomment-703696543


   > Is it the same requirement as the limit-count?
   
   yes, almost the same.



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:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on issue #2327: doc: add grpc-proxy.md link in `doc/README.md`

2020-10-05 Thread GitBox


membphis commented on issue #2327:
URL: https://github.com/apache/apisix/issues/2327#issuecomment-703695646


   @liuhengloveyou you can make a try, choose a good one you think.
   
   The community is public



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:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on a change in pull request #2357: bugfix: set random seed for each worker process at `init_worker` phase, only `init` phase is not enough.

2020-10-05 Thread GitBox


membphis commented on a change in pull request #2357:
URL: https://github.com/apache/apisix/pull/2357#discussion_r499666429



##
File path: apisix/init.lua
##
@@ -82,6 +75,14 @@ end
 
 
 function _M.http_init_worker()
+local seed, err = core.utils.get_seed_from_urandom()
+if not seed then
+core.log.warn('failed to get seed from urandom: ', err)
+seed = ngx_now() * 1000 + ngx.worker.pid()
+end
+math.randomseed(seed)
+core.log.info("random test in [1, 1]: ", math.random(1, 100))

Review comment:
   why do we need to remove this line?
   It is necessary for debugging.





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:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on a change in pull request #2340: feature: limit-count use redis cluster

2020-10-05 Thread GitBox


membphis commented on a change in pull request #2340:
URL: https://github.com/apache/apisix/pull/2340#discussion_r499664897



##
File path: rockspec/apisix-master-0.rockspec
##
@@ -54,6 +54,7 @@ dependencies = {
 "skywalking-nginx-lua-plugin = 1.0-0",
 "base64 = 1.5-2",
 "dkjson = 2.5-2",
+"lua-resty-redis-cluster = 1.1-0",

Review comment:
   https://luarocks.org/modules/steve0511/resty-redis-cluster
   
   we can use this library now. @liuhengloveyou 





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:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on issue #2330: request help: Apisix host configuration of route can not be '*' ?

2020-10-05 Thread GitBox


membphis commented on issue #2330:
URL: https://github.com/apache/apisix/issues/2330#issuecomment-703685591


   if you set `*` for field `host`, it means matching any host.
   
   for this case, you do not need to set field `host`.
   
   > So, I want to know why the host limit cannot be config *.
   
   if you want to set  host to `*`, you do not need to set the field "host".



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:
us...@infra.apache.org




[GitHub] [apisix-dashboard] nic-chen commented on pull request #535: feat: refactor apis for existing check and other apis

2020-10-05 Thread GitBox


nic-chen commented on pull request #535:
URL: https://github.com/apache/apisix-dashboard/pull/535#issuecomment-703637526


   > This method is not right. What is the license of the original code? 
   
   the Apache License, Version 2.0
   
   



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:
us...@infra.apache.org




[GitHub] [apisix-dashboard] moonming commented on pull request #535: feat: refactor apis for existing check and other apis

2020-10-05 Thread GitBox


moonming commented on pull request #535:
URL: https://github.com/apache/apisix-dashboard/pull/535#issuecomment-703636101


   This method is not right. What is the license of the original code?
   
   nic-chen 于2020年10月5日 周一下午9:31写道:
   
   >
   >
   > *@nic-chen* commented on this pull request.
   >
   >
   >
   >
   > --
   >
   >
   >
   >
   > In api/internal/core/store/query.go
   > 
   > :
   >
   >
   > > + * 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.
   >
   > + */
   >
   > +// Copyright 2017 The Kubernetes Authors.
   >
   >
   >
   > some code copy from Kubernetes dashboard , so i think it's better to keep
   > their license. what do you think ? @moonming 
   >
   >
   >
   >
   > —
   > You are receiving this because you were mentioned.
   >
   >
   > Reply to this email directly, view it on GitHub
   > 
,
   > or unsubscribe
   > 

   > .
   >
   >
   > --
   Thanks,
   Ming Wen
   Twitter: _WenMing
   



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:
us...@infra.apache.org




[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #535: feat: refactor apis for existing check and other apis

2020-10-05 Thread GitBox


nic-chen commented on a change in pull request #535:
URL: https://github.com/apache/apisix-dashboard/pull/535#discussion_r499599913



##
File path: api/internal/core/store/query.go
##
@@ -0,0 +1,151 @@
+/*
+ * 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.
+ */
+// Copyright 2017 The Kubernetes Authors.

Review comment:
   some code copy from Kubernetes dashboard , so i think it's better to  
keep their license. what do you think ? @moonming 





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:
us...@infra.apache.org




[GitHub] [apisix] moonming commented on a change in pull request #2357: bugfix: set random seed for each worker process at `init_worker` phase, only `init` phase is not enough.

2020-10-05 Thread GitBox


moonming commented on a change in pull request #2357:
URL: https://github.com/apache/apisix/pull/2357#discussion_r499571920



##
File path: apisix/init.lua
##
@@ -82,6 +75,14 @@ end
 
 
 function _M.http_init_worker()
+local seed, err = core.utils.get_seed_from_urandom()
+if not seed then
+core.log.warn('failed to get seed from urandom: ', err)
+seed = ngx_now() * 1000 + ngx.worker.pid()
+end
+math.randomseed(seed)
+core.log.info("random test in [1, 1]: ", math.random(1, 100))

Review comment:
   should be removed

##
File path: apisix/init.lua
##
@@ -759,6 +760,14 @@ end
 
 function _M.stream_init_worker()
 core.log.info("enter stream_init_worker")
+local seed, err = core.utils.get_seed_from_urandom()
+if not seed then
+core.log.warn('failed to get seed from urandom: ', err)
+seed = ngx_now() * 1000 + ngx.worker.pid()
+end
+math.randomseed(seed)
+core.log.info("random stream test in [1, 1]: ", math.random(1, 
100))

Review comment:
   ditto





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:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on pull request #2357: bugfix: set random seed for each worker process at `init_worker` phase, only `init` phase is not enough.

2020-10-05 Thread GitBox


membphis commented on pull request #2357:
URL: https://github.com/apache/apisix/pull/2357#issuecomment-703591388


   > And we should remove random in `init` phase if add random in `init_worker` 
phase.
   
   you are right. let me do this 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:
us...@infra.apache.org




[GitHub] [apisix-dashboard] moonming commented on a change in pull request #535: feat: refactor apis for existing check and other apis

2020-10-05 Thread GitBox


moonming commented on a change in pull request #535:
URL: https://github.com/apache/apisix-dashboard/pull/535#discussion_r499509595



##
File path: api/internal/core/store/selector.go
##
@@ -0,0 +1,144 @@
+/*
+ * 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.
+ */
+// Copyright 2017 The Kubernetes Authors.

Review comment:
   ditto

##
File path: api/internal/core/store/selector_test.go
##
@@ -0,0 +1,238 @@
+/*
+ * 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.
+ */
+// Copyright 2017 The Kubernetes Authors.

Review comment:
   ditto

##
File path: api/internal/core/store/query.go
##
@@ -0,0 +1,151 @@
+/*
+ * 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.
+ */
+// Copyright 2017 The Kubernetes Authors.

Review comment:
   Is this file from Kubernetes repo?





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:
us...@infra.apache.org




[GitHub] [apisix-dashboard] gxthrj commented on a change in pull request #535: feat: refactor apis for existing check and other apis

2020-10-05 Thread GitBox


gxthrj commented on a change in pull request #535:
URL: https://github.com/apache/apisix-dashboard/pull/535#discussion_r499469879



##
File path: api/internal/core/store/query.go
##
@@ -0,0 +1,151 @@
+/*
+ * 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.
+ */
+// Copyright 2017 The Kubernetes Authors.

Review comment:
   are these headers must to be kept ?

##
File path: api/internal/core/entity/query.go
##
@@ -0,0 +1,113 @@
+/*
+ * 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.
+ */
+/*
+ * 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.
+ */

Review comment:
   Duplicate header





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:
us...@infra.apache.org




[GitHub] [apisix] tokers commented on issue #2303: Proposal: inptroduce traffic split plugin

2020-10-05 Thread GitBox


tokers commented on issue #2303:
URL: https://github.com/apache/apisix/issues/2303#issuecomment-703507376


   > I like this proposal very much and think it will be the final form.
   > 
   > This function can be divided into two parts:
   > 
   > 1.label &&  selector;
   > 
   > 2. A grayscale upgrade configuration;
   > 
   > These two things can be done simultaneously.
   > 
   > 
   > 
   > 1. Implement label && selector to replace the current upstream_id binding 
relationship;
   > 
   > 2. The configuration method of grayscale upgrade can be realized by a 
plug-in version first. 
   > 
   > After waiting for the label function to be implemented, the gray scale 
capability is migrated to the native implementation in the apisix object.
   > 
   > 
   > 
   > The plug-in configuration is similar to this:
   > 
   > 
   > 
   > ```json
   > 
   > "plugins":{
   > 
   >"routex": {
   > 
   >"rules": [
   > 
   >{
   > 
   >"match": [
   > 
   >{
   > 
   >"vars": [
   > 
   >[ "arg_user_id", ">=", 13],
   > 
   >[ "arg_user_id", "<=", 133]
   > 
   >]
   > 
   >},
   > 
   >{
   > 
   >"vars": [
   > 
   >[ "arg_user_id", "==", 222]
   > 
   >]
   > 
   >}
   > 
   >],
   > 
   >"upstreams": [
   > 
   >{
   > 
   >"upstream_id": 3,
   > 
   >"weight": 20
   > 
   >},
   > 
   >{
   > 
   >"upstream_id": 5,
   > 
   >"weight": 80
   > 
   >}
   > 
   >]
   > 
   >}
   > 
   >]
   > 
   >}
   > 
   > }
   > 
   > ```
   
   We need further discussion after @moonming and @membphis have some time to 
analyze this proposal.



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:
us...@infra.apache.org




[GitHub] [apisix] xyz2b commented on issue #2330: request help: Apisix host configuration of route can not be '*' ?

2020-10-05 Thread GitBox


xyz2b commented on issue #2330:
URL: https://github.com/apache/apisix/issues/2330#issuecomment-703505259


   Sorry. The last condition of this regular expression `|^\\*$` is added by 
myself. The regular expression in the original code is `local host_def_pat = 
"^\*?[0-9a-zA-Z-.]+$"`. So, I want to know why the host limit cannot be config 
`*`.



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:
us...@infra.apache.org




[GitHub] [apisix] xyz2b commented on issue #2330: request help: Apisix host configuration of route can not be '*' ?

2020-10-05 Thread GitBox


xyz2b commented on issue #2330:
URL: https://github.com/apache/apisix/issues/2330#issuecomment-703504707


   Sorry. The last condition of this regular expression `|^\\*$` is added by 
myself. The regular expression in the original code is local host_def_pat = 
"^\\*?[0-9a-zA-Z-.]+$". So, I want to know why the host limit cannot be config 
`*`.



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:
us...@infra.apache.org




[GitHub] [apisix] xyz2b removed a comment on issue #2330: request help: Apisix host configuration of route can not be '*' ?

2020-10-05 Thread GitBox


xyz2b removed a comment on issue #2330:
URL: https://github.com/apache/apisix/issues/2330#issuecomment-703504707


   Sorry. The last condition of this regular expression `|^\\*$` is added by 
myself. The regular expression in the original code is local host_def_pat = 
"^\\*?[0-9a-zA-Z-.]+$". So, I want to know why the host limit cannot be config 
`*`.



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:
us...@infra.apache.org




[GitHub] [apisix] xyz2b removed a comment on issue #2330: request help: Apisix host configuration of route can not be '*' ?

2020-10-05 Thread GitBox


xyz2b removed a comment on issue #2330:
URL: https://github.com/apache/apisix/issues/2330#issuecomment-703504248


   Sorry. The last condition of this regular expression (^\\*$) is added by 
myself. The regular expression in the original code is `local host_def_pat = 
"^\\*?[0-9a-zA-Z-.]+$"`. So, I want to know why the host limit cannot be config 
'*'.
   
   



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:
us...@infra.apache.org




[GitHub] [apisix] xyz2b commented on issue #2330: request help: Apisix host configuration of route can not be '*' ?

2020-10-05 Thread GitBox


xyz2b commented on issue #2330:
URL: https://github.com/apache/apisix/issues/2330#issuecomment-703504248


   Sorry. The last condition of this regular expression (^\\*$) is added by 
myself. The regular expression in the original code is `local host_def_pat = 
"^\\*?[0-9a-zA-Z-.]+$"`. So, I want to know why the host limit cannot be config 
'*'.
   
   



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:
us...@infra.apache.org