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/11/19 07:31:57 UTC
[GitHub] [apisix] Hmemories opened a new pull request #2793: modify balancer.lua to solve issue that discovery Eureka cannot autom…
Hmemories opened a new pull request #2793:
URL: https://github.com/apache/apisix/pull/2793
…atically proxy to a new node
### What this PR does / why we need it:
to solve issue that discovery Eureka cannot automatically proxy to a new node #1838
### Pre-submission checklist:
* [ ] Did you explain what problem does this PR solve? Or what new features have been added?
When we are getting the cached data, if we match "key" with the data"md5" of up_conf.nodes, we can find the changes of the service.
* [ ] 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] tokers commented on pull request #2793: modify balancer.lua to solve issue that discovery Eureka cannot autom…
Posted by GitBox <gi...@apache.org>.
tokers commented on pull request #2793:
URL: https://github.com/apache/apisix/pull/2793#issuecomment-730801901
@Hmemories CI run is failed, please take a look :).
----------------------------------------------------------------
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] Hmemories commented on a change in pull request #2793: modify balancer.lua to solve issue that discovery Eureka cannot autom…
Posted by GitBox <gi...@apache.org>.
Hmemories commented on a change in pull request #2793:
URL: https://github.com/apache/apisix/pull/2793#discussion_r551126854
##########
File path: apisix/balancer.lua
##########
@@ -218,8 +219,9 @@ local function pick_server(route, ctx)
if checker then
version = version .. "#" .. checker.status_ver
end
+ local cache_key = key..ngx.md5(up_conf.nodes)
Review comment:
嗯嗯,我准备在看看,这部分代码已经被我是用在了生产环境我在考虑有没有好的方式优化它
----------------------------------------------------------------
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] github-actions[bot] commented on pull request #2793: modify balancer.lua to solve issue that discovery Eureka cannot autom…
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #2793:
URL: https://github.com/apache/apisix/pull/2793#issuecomment-906272153
This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.
--
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] Hmemories commented on a change in pull request #2793: modify balancer.lua to solve issue that discovery Eureka cannot autom…
Posted by GitBox <gi...@apache.org>.
Hmemories commented on a change in pull request #2793:
URL: https://github.com/apache/apisix/pull/2793#discussion_r551127072
##########
File path: apisix/balancer.lua
##########
@@ -218,8 +219,9 @@ local function pick_server(route, ctx)
if checker then
version = version .. "#" .. checker.status_ver
end
+ local cache_key = key..ngx.md5(up_conf.nodes)
Review comment:
如果md5比较重的话,hash是不是也可以
----------------------------------------------------------------
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 commented on a change in pull request #2793: modify balancer.lua to solve issue that discovery Eureka cannot autom…
Posted by GitBox <gi...@apache.org>.
tokers commented on a change in pull request #2793:
URL: https://github.com/apache/apisix/pull/2793#discussion_r527358913
##########
File path: apisix/balancer.lua
##########
@@ -218,8 +219,9 @@ local function pick_server(route, ctx)
if checker then
version = version .. "#" .. checker.status_ver
end
+ local cache_key = key..ngx.md5(up_conf.nodes)
Review comment:
Or settling for the second best, just use the up_conf.version.
----------------------------------------------------------------
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 #2793: modify balancer.lua to solve issue that discovery Eureka cannot autom…
Posted by GitBox <gi...@apache.org>.
membphis commented on pull request #2793:
URL: https://github.com/apache/apisix/pull/2793#issuecomment-757853406
ping @Hmemories
----------------------------------------------------------------
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] moonming commented on a change in pull request #2793: modify balancer.lua to solve issue that discovery Eureka cannot autom…
Posted by GitBox <gi...@apache.org>.
moonming commented on a change in pull request #2793:
URL: https://github.com/apache/apisix/pull/2793#discussion_r551643110
##########
File path: apisix/balancer.lua
##########
@@ -218,8 +219,9 @@ local function pick_server(route, ctx)
if checker then
version = version .. "#" .. checker.status_ver
end
+ local cache_key = key..ngx.md5(up_conf.nodes)
Review comment:
md5 is good to me
----------------------------------------------------------------
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] moonming commented on pull request #2793: modify balancer.lua to solve issue that discovery Eureka cannot autom…
Posted by GitBox <gi...@apache.org>.
moonming commented on pull request #2793:
URL: https://github.com/apache/apisix/pull/2793#issuecomment-754302115
@Hmemories it will be perfect if you can add 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] github-actions[bot] closed pull request #2793: modify balancer.lua to solve issue that discovery Eureka cannot autom…
Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #2793:
URL: https://github.com/apache/apisix/pull/2793
--
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 pull request #2793: modify balancer.lua to solve issue that discovery Eureka cannot autom…
Posted by GitBox <gi...@apache.org>.
tokers commented on pull request #2793:
URL: https://github.com/apache/apisix/pull/2793#issuecomment-730807001
@Hmemories Missing 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] github-actions[bot] commented on pull request #2793: modify balancer.lua to solve issue that discovery Eureka cannot autom…
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #2793:
URL: https://github.com/apache/apisix/pull/2793#issuecomment-926505972
This pull request/issue has been closed due to lack of activity. If you think that is incorrect, or the pull request requires review, you can revive the PR at any 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.
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 #2793: modify balancer.lua to solve issue that discovery Eureka cannot autom…
Posted by GitBox <gi...@apache.org>.
tokers commented on a change in pull request #2793:
URL: https://github.com/apache/apisix/pull/2793#discussion_r527356656
##########
File path: apisix/balancer.lua
##########
@@ -218,8 +219,9 @@ local function pick_server(route, ctx)
if checker then
version = version .. "#" .. checker.status_ver
end
+ local cache_key = key..ngx.md5(up_conf.nodes)
Review comment:
The argument type of `ngx.md5` is string while `up_conf.nodes` is an array-like table.
BTW, i don't think calculating the md5sum of nodes is a good way to differentiate the version, it's heavy, what about introducing the version mechanism for `up_conf.nodes`, either version number or last modify time is OK.
##########
File path: apisix/balancer.lua
##########
@@ -218,8 +219,9 @@ local function pick_server(route, ctx)
if checker then
version = version .. "#" .. checker.status_ver
end
+ local cache_key = key..ngx.md5(up_conf.nodes)
Review comment:
style: need space on both left and right side of `..`.
----------------------------------------------------------------
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