You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/07/06 08:09:51 UTC

[GitHub] [shardingsphere] csonezp opened a new pull request, #18893: listen on specified addresses

csonezp opened a new pull request, #18893:
URL: https://github.com/apache/shardingsphere/pull/18893

   Fixes #18554 .
   
   To be compatible with both ways, I modified the start script and gave default values for port and conf path .
   If the user does not set port or conf path, they will be set to -1/${DEPLOY_DIR}/conf.
   The default value for port is -1, that mean user did not specify a port, and it will return Optional.empty() when getPort.
   
   @TeslaCN is this solution correct? can you give me some suggestions to improve the code quality? Thanks!
   
   Changes proposed in this pull request:
   - support listen on specified addresses
   


-- 
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@shardingsphere.apache.org

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


[GitHub] [shardingsphere] csonezp commented on pull request #18893: listen on specified addresses

Posted by GitBox <gi...@apache.org>.
csonezp commented on PR #18893:
URL: https://github.com/apache/shardingsphere/pull/18893#issuecomment-1177462460

   > Hi @csonezp I tried your branch and I found a problem:
   > 
   > I wrote an absolute path of config directory:
   > 
   > ```shell
   > bin/start.sh 33306 /home/wuweijie/dev/shardingsphere/proxy/master/mysql/conf
   > ```
   > 
   > But the absolute path was prefixed with `DEPLOY_DIR`
   > 
   > ```
   > $ tail logs/stdout.log                                                                                                                                                                                                                                                                                             [16:44:09]
   >         at org.apache.shardingsphere.proxy.backend.config.ProxyConfigurationLoader.load(ProxyConfigurationLoader.java:60)
   >         at org.apache.shardingsphere.proxy.Bootstrap.main(Bootstrap.java:49)
   > Exception in thread "main" java.io.FileNotFoundException: /home/wuweijie/projects/shardingsphere/shardingsphere-distribution/shardingsphere-proxy-distribution/target/apache-shardingsphere-5.1.3-SNAPSHOT-shardingsphere-proxy-bin/home/wuweijie/dev/shardingsphere/proxy/master/mysql/conf/server.yaml (No such file or directory)
   >         at java.base/java.io.FileInputStream.open0(Native Method)
   >         at java.base/java.io.FileInputStream.open(FileInputStream.java:216)
   >         at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
   >         at org.apache.shardingsphere.infra.yaml.engine.YamlEngine.unmarshal(YamlEngine.java:54)
   >         at org.apache.shardingsphere.proxy.backend.config.ProxyConfigurationLoader.loadServerConfiguration(ProxyConfigurationLoader.java:74)
   >         at org.apache.shardingsphere.proxy.backend.config.ProxyConfigurationLoader.load(ProxyConfigurationLoader.java:60)
   >         at org.apache.shardingsphere.proxy.Bootstrap.main(Bootstrap.java:49)
   > ```
   
   @TeslaCN my bad, I will go through the script and write a test report. Is there a way to test the script file in the source code?
   
   And I found a bug in master branch: if user wrote an absolute path, the script  will merge  the absolute path and ${DEPLOY_DIR},  and then add the result to ${CLASS_PATH}. Like this:
   ![image](https://user-images.githubusercontent.com/3190994/177762773-1bbfd115-68bb-428a-b6b3-818fa817e392.png)
   should i fix it?


-- 
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@shardingsphere.apache.org

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


[GitHub] [shardingsphere] codecov-commenter commented on pull request #18893: listen on specified addresses

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #18893:
URL: https://github.com/apache/shardingsphere/pull/18893#issuecomment-1176114468

   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/18893?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18893](https://codecov.io/gh/apache/shardingsphere/pull/18893?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b4575d9) into [master](https://codecov.io/gh/apache/shardingsphere/commit/96f4bedf0ab74dceff1454eae33a40b974f6fbac?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (96f4bed) will **decrease** coverage by `0.01%`.
   > The diff coverage is `52.74%`.
   
   > :exclamation: Current head b4575d9 differs from pull request most recent head 5c683be. Consider uploading reports for the commit 5c683be to get more accurate results
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #18893      +/-   ##
   ============================================
   - Coverage     59.26%   59.25%   -0.02%     
   - Complexity     2283     2292       +9     
   ============================================
     Files          3764     3779      +15     
     Lines         54435    54524      +89     
     Branches       9211     9225      +14     
   ============================================
   + Hits          32262    32309      +47     
   - Misses        19460    19496      +36     
   - Partials       2713     2719       +6     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/18893?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...sharding/api/config/ShardingRuleConfiguration.java](https://codecov.io/gh/apache/shardingsphere/pull/18893/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFyZGluZy9hcGkvY29uZmlnL1NoYXJkaW5nUnVsZUNvbmZpZ3VyYXRpb24uamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...onfig/rule/ShardingAutoTableRuleConfiguration.java](https://codecov.io/gh/apache/shardingsphere/pull/18893/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFyZGluZy9hcGkvY29uZmlnL3J1bGUvU2hhcmRpbmdBdXRvVGFibGVSdWxlQ29uZmlndXJhdGlvbi5qYXZh) | `0.00% <ø> (ø)` | |
   | [...pi/config/rule/ShardingTableRuleConfiguration.java](https://codecov.io/gh/apache/shardingsphere/pull/18893/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFyZGluZy9hcGkvY29uZmlnL3J1bGUvU2hhcmRpbmdUYWJsZVJ1bGVDb25maWd1cmF0aW9uLmphdmE=) | `0.00% <ø> (ø)` | |
   | [...tegy/audit/ShardingAuditStrategyConfiguration.java](https://codecov.io/gh/apache/shardingsphere/pull/18893/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFyZGluZy9hcGkvY29uZmlnL3N0cmF0ZWd5L2F1ZGl0L1NoYXJkaW5nQXVkaXRTdHJhdGVneUNvbmZpZ3VyYXRpb24uamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...g/yaml/config/rule/YamlTableRuleConfiguration.java](https://codecov.io/gh/apache/shardingsphere/pull/18893/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcveWFtbC9jb25maWcvcnVsZS9ZYW1sVGFibGVSdWxlQ29uZmlndXJhdGlvbi5qYXZh) | `100.00% <ø> (ø)` | |
   | [.../audit/YamlShardingAuditStrategyConfiguration.java](https://codecov.io/gh/apache/shardingsphere/pull/18893/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcveWFtbC9jb25maWcvc3RyYXRlZ3kvYXVkaXQvWWFtbFNoYXJkaW5nQXVkaXRTdHJhdGVneUNvbmZpZ3VyYXRpb24uamF2YQ==) | `100.00% <ø> (ø)` | |
   | [...RuleAlgorithmProviderConfigurationYamlSwapper.java](https://codecov.io/gh/apache/shardingsphere/pull/18893/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcveWFtbC9zd2FwcGVyL1NoYXJkaW5nUnVsZUFsZ29yaXRobVByb3ZpZGVyQ29uZmlndXJhdGlvbllhbWxTd2FwcGVyLmphdmE=) | `10.34% <0.00%> (+0.17%)` | :arrow_up: |
   | [.../handler/query/ShardingAuditorsQueryResultSet.java](https://codecov.io/gh/apache/shardingsphere/pull/18893/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctZGlzdHNxbC9zaGFyZGluZ3NwaGVyZS1zaGFyZGluZy1kaXN0c3FsLWhhbmRsZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NoYXJkaW5nL2Rpc3RzcWwvaGFuZGxlci9xdWVyeS9TaGFyZGluZ0F1ZGl0b3JzUXVlcnlSZXN1bHRTZXQuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...l/parser/core/ShardingDistSQLStatementVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/18893/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctZGlzdHNxbC9zaGFyZGluZ3NwaGVyZS1zaGFyZGluZy1kaXN0c3FsLXBhcnNlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvZGlzdHNxbC9wYXJzZXIvY29yZS9TaGFyZGluZ0Rpc3RTUUxTdGF0ZW1lbnRWaXNpdG9yLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...tsql/exception/rule/DuplicateAuditorException.java](https://codecov.io/gh/apache/shardingsphere/pull/18893/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9kaXN0c3FsL2V4Y2VwdGlvbi9ydWxlL0R1cGxpY2F0ZUF1ZGl0b3JFeGNlcHRpb24uamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | ... and [50 more](https://codecov.io/gh/apache/shardingsphere/pull/18893/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/18893?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/18893?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [96f4bed...5c683be](https://codecov.io/gh/apache/shardingsphere/pull/18893?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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@shardingsphere.apache.org

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


[GitHub] [shardingsphere] tristaZero commented on pull request #18893: listen on specified addresses

Posted by GitBox <gi...@apache.org>.
tristaZero commented on PR #18893:
URL: https://github.com/apache/shardingsphere/pull/18893#issuecomment-1179732688

   Hello @csonezp Thanks for this nice feature, which will be included in the next release, look forward!
   @TeslaCN Patient review!


-- 
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@shardingsphere.apache.org

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


[GitHub] [shardingsphere] csonezp commented on a diff in pull request #18893: listen on specified addresses

Posted by GitBox <gi...@apache.org>.
csonezp commented on code in PR #18893:
URL: https://github.com/apache/shardingsphere/pull/18893#discussion_r914598881


##########
shardingsphere-distribution/shardingsphere-proxy-distribution/src/main/resources/bin/start.sh:
##########
@@ -61,10 +61,23 @@ JAVA_MEM_OPTS=" -server -Xmx2g -Xms2g -Xmn1g -Xss1m -XX:AutoBoxCacheMax=4096 -XX
 
 MAIN_CLASS=org.apache.shardingsphere.proxy.Bootstrap
 
+unset -v PORT
+unset -v ADDRESSES
+unset -v CONF_PATH
+
 print_usage() {
-    echo "usage: start.sh [port] [config_dir]"
+    echo "usage:"
+    echo "start.sh [port] [config_dir]"
     echo "  port: proxy listen port, default is 3307"
-    echo "  config_dir: proxy config directory, default is conf"
+    echo "  config_dir: proxy config directory, default is 'conf'"
+    echo ""
+    echo "start.sh [-h addresses] [-p port] [-c /path/to/conf]"

Review Comment:
   > We have already changed the `-h`.
   
   @TeslaCN 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.

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

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


[GitHub] [shardingsphere] TeslaCN merged pull request #18893: listen on specified addresses

Posted by GitBox <gi...@apache.org>.
TeslaCN merged PR #18893:
URL: https://github.com/apache/shardingsphere/pull/18893


-- 
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@shardingsphere.apache.org

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


[GitHub] [shardingsphere] csonezp commented on a diff in pull request #18893: listen on specified addresses

Posted by GitBox <gi...@apache.org>.
csonezp commented on code in PR #18893:
URL: https://github.com/apache/shardingsphere/pull/18893#discussion_r914598881


##########
shardingsphere-distribution/shardingsphere-proxy-distribution/src/main/resources/bin/start.sh:
##########
@@ -61,10 +61,23 @@ JAVA_MEM_OPTS=" -server -Xmx2g -Xms2g -Xmn1g -Xss1m -XX:AutoBoxCacheMax=4096 -XX
 
 MAIN_CLASS=org.apache.shardingsphere.proxy.Bootstrap
 
+unset -v PORT
+unset -v ADDRESSES
+unset -v CONF_PATH
+
 print_usage() {
-    echo "usage: start.sh [port] [config_dir]"
+    echo "usage:"
+    echo "start.sh [port] [config_dir]"
     echo "  port: proxy listen port, default is 3307"
-    echo "  config_dir: proxy config directory, default is conf"
+    echo "  config_dir: proxy config directory, default is 'conf'"
+    echo ""
+    echo "start.sh [-h addresses] [-p port] [-c /path/to/conf]"

Review Comment:
   > We have already changed the `-h`.
   
   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.

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

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


[GitHub] [shardingsphere] TeslaCN commented on a diff in pull request #18893: listen on specified addresses

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on code in PR #18893:
URL: https://github.com/apache/shardingsphere/pull/18893#discussion_r914595822


##########
shardingsphere-distribution/shardingsphere-proxy-distribution/src/main/resources/bin/start.sh:
##########
@@ -61,10 +61,23 @@ JAVA_MEM_OPTS=" -server -Xmx2g -Xms2g -Xmn1g -Xss1m -XX:AutoBoxCacheMax=4096 -XX
 
 MAIN_CLASS=org.apache.shardingsphere.proxy.Bootstrap
 
+unset -v PORT
+unset -v ADDRESSES
+unset -v CONF_PATH
+
 print_usage() {
-    echo "usage: start.sh [port] [config_dir]"
+    echo "usage:"
+    echo "start.sh [port] [config_dir]"
     echo "  port: proxy listen port, default is 3307"
-    echo "  config_dir: proxy config directory, default is conf"
+    echo "  config_dir: proxy config directory, default is 'conf'"
+    echo ""
+    echo "start.sh [-h addresses] [-p port] [-c /path/to/conf]"

Review Comment:
   We have already changed the `-h`.



-- 
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@shardingsphere.apache.org

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


[GitHub] [shardingsphere] csonezp commented on pull request #18893: listen on specified addresses

Posted by GitBox <gi...@apache.org>.
csonezp commented on PR #18893:
URL: https://github.com/apache/shardingsphere/pull/18893#issuecomment-1178805473

   @TeslaCN 


-- 
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@shardingsphere.apache.org

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


[GitHub] [shardingsphere] TeslaCN commented on pull request #18893: listen on specified addresses

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on PR #18893:
URL: https://github.com/apache/shardingsphere/pull/18893#issuecomment-1178423610

   You could fix it if you like.


-- 
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@shardingsphere.apache.org

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