You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "pallavithegod (via GitHub)" <gi...@apache.org> on 2026/10/15 11:36:51 UTC

[PR] Preserve Consul addresses when connection list starts with commas [skywalking]

pallavithegod opened a new pull request, #14144:
URL: https://github.com/apache/skywalking/pull/14144

   ### Fix multi-node Consul connection strings with leading commas
   - [x] Add a unit test to verify that the fix works.
   - [x] Explain briefly why the bug exists and how to fix it.
   
   When a connection string starts with a comma, `replace(",", "")` removes every separator. A supported leading delimiter therefore breaks multi-node configurations: `,10.0.0.1:8500,10.0.0.2:8501` becomes an invalid concatenated address before the Consul provider can initialize.
   
   Remove only the leading run of commas. Internal separators and the existing trailing-comma handling remain available to the parser. The existing all-comma rejection is preserved.
   
   Regression coverage checks that all three node addresses and ports survive a leading/trailing delimiter and that an empty address inside a list is still rejected. Existing connection-string tests are also run.
   
   Validation (JDK 21, Java 11 release target):
   
   ```text
   ./mvnw -B -q -pl oap-server/server-library/library-util -am test -Dtest=ConnectUtilTestCase,ConnectUtilsLeadingCommaTest -Dsurefire.failIfNoSpecifiedTests=false -Dcheckstyle.skip
   ```
   
   Compilation, Javadoc, Checkstyle, and license headers are checked locally.
   
   - [ ] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Not applicable; reproduction is included above.
   - [x] Update the [`CHANGES` log](https://github.com/apache/skywalking/blob/master/docs/en/changes/changes.md).
   
   


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

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


Re: [PR] Preserve Consul addresses when connection list starts with commas [skywalking]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #14144:
URL: https://github.com/apache/skywalking/pull/14144#issuecomment-6192103246

   Thanks for the contribution, but this isn't a bug. A leading comma isn't a supported format for the Consul `hostPort`. The documented format is `10.0.0.1:8500,10.0.0.2:8500,10.0.0.3:8500` (see `docs/en/setup/backend/backend-cluster.md`). A list that starts with a comma already fails at boot with `Invalid connect string pattern.`, so it can't silently produce a wrong cluster config. Closing as invalid.


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

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


Re: [PR] Preserve Consul addresses when connection list starts with commas [skywalking]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng closed pull request #14144: Preserve Consul addresses when connection list starts with commas
URL: https://github.com/apache/skywalking/pull/14144


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

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