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/06/26 11:13:06 UTC

[GitHub] [apisix] adugeek opened a new pull request #4488: feat(stream): support stream subsystem discovery

adugeek opened a new pull request #4488:
URL: https://github.com/apache/apisix/pull/4488


   Signed-off-by: adugeek <ro...@libssl.com>
   
   ### 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. -->
   
    int function init.lua:stream_init_worker() not call discovery.init_worker(), 
    so, we can't use discovery in stream subsystem.
    by this pr, we can slove it
    of course, the current and future discovery components need to ensure they can work in the stream subsystem 
   
   ### 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? **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] adugeek closed pull request #4488: feat(stream): support stream subsystem discovery

Posted by GitBox <gi...@apache.org>.
adugeek closed pull request #4488:
URL: https://github.com/apache/apisix/pull/4488


   


-- 
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 #4488: feat(stream): support stream subsystem discovery

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



##########
File path: apisix/init.lua
##########
@@ -823,6 +823,11 @@ function _M.stream_init_worker()
         core.config.init_worker()
     end
 
+    local discovery = require("apisix.discovery.init").discovery
+    if discovery and discovery.init_worker then
+        discovery.init_worker()
+    end

Review comment:
       You can add a test with the DNS discovery: https://github.com/apache/apisix/blob/07bfe5b9c03ad361cb71541eb02fd661f1323213/t/discovery/dns/sanity.t#L91
   
   You can setup it with https://github.com/apache/apisix/blob/07bfe5b9c03ad361cb71541eb02fd661f1323213/utils/set-dns.sh#L33




-- 
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] Yiyiyimu commented on a change in pull request #4488: feat(stream): support stream subsystem discovery

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



##########
File path: t/discovery/dns/sanity.t
##########
@@ -284,3 +284,34 @@ qr/proxy request to \S+/
 --- grep_error_log_out
 proxy request to 127.0.0.1:1979
 proxy request to 127.0.0.2:1980
+
+=== TEST 14: Stream Discovery
+--- yaml_config
+apisix:
+    node_listen: 1984
+    config_center: yaml
+    enable_admin: false
+    enable_resolv_search_option: false
+    stream_proxy:
+        tcp:
+            - addr: 1985
+discovery:                        # service discovery center

Review comment:
       ```suggestion
   discovery:
   ```




-- 
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] adugeek commented on pull request #4488: feat(stream): support stream subsystem discovery

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


   @tokers sorry, busying in the past week.
    and it takes a little time to learn "how to write test case"


-- 
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 #4488: feat(stream): support stream subsystem discovery

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



##########
File path: t/discovery/dns/sanity.t
##########
@@ -284,3 +284,34 @@ qr/proxy request to \S+/
 --- grep_error_log_out
 proxy request to 127.0.0.1:1979
 proxy request to 127.0.0.2:1980
+
+=== TEST 14: Stream Discovery
+--- yaml_config
+apisix:
+    node_listen: 1984
+    config_center: yaml
+    enable_admin: false
+    enable_resolv_search_option: false
+    stream_proxy:
+        tcp:
+            - addr: 1985
+discovery:                        # service discovery center
+    dns:
+        servers: "127.0.0.1:1053"
+--- apisix_yaml
+stream_routes:
+    - id: 1
+      server_port: 1985
+      upstream_id: 1
+upstreams:
+    - service_name: "zero-weight.srv.test.local"
+      discovery_type: dns
+      type: roundrobin
+      id: 1
+--- stream_enable
+--- stream_request eval
+"GET /hello HTTP/1.1"
+--- stream_response
+hello world
+--- no_error_log
+[error]

Review comment:
       Should add the EOS symbol. Please check your editor.




-- 
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 #4488: feat(stream): support stream subsystem discovery

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


   @adugeek Please check out the CI status.


-- 
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 #4488: feat(stream): support stream subsystem discovery

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


   @adugeek Please add some test cases to verify the changes are effective.


-- 
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] Yiyiyimu commented on pull request #4488: feat(stream): support stream subsystem discovery

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


   @adugeek CI failed, please recheck


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