Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugFix: when hostname start with applicationName, will cause parse faile… #1052

Merged

Conversation

lunescode
Copy link
Contributor

What is the purpose of the change

when hostname start with applicationName, will cause parse failed, resuslt in can't find instace from eureka.
for example,
hostname:"linkis-cg-linkis-cg-engineconnmanager-1"
aplicationName: "linkis-cg-engineconnmanager"
he service registed in eureka: "linkis-cg-linkis-cg-engineconnmanager-1:linkis-cg-linkis-cg-engineconnmanager:9102"

the code "instanceId.toLowerCase.indexOf(applicationName.toLowerCase)" will return 0.

Brief change log

  • More stringent match in the code line 42 of EurekaRPCServerLoader.java

Verifying this change

This change added tests and can be verified as follows:

    1. set engineconnmanager's hostname "linkis-cg-linkis-cg-engineconnmanager-1",which contains aplicationName "linkis-cg-engineconnmanager", then start all service.
    1. start a shell engine, if execute success the pass the test.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (no)
  • Anything that affects deployment: (no )
  • The MGS(Microservice Governance Services), i.e., Spring Cloud Gateway, OpenFeign, Eureka.: (no)

Documentation

  • Does this pull request introduce a new feature? (no)
  • If yes, how is the feature documented? (not applicable)

…d, resuslt in can't find instace from eureka. for example,hostname:linkis-cg-linkis-cg-engineconnmanager-1, aplicationName:linkis-cg-engineconnmanager,the service registed in eureka "linkis-cg-linkis-cg-engineconnmanager-1:linkis-cg-linkis-cg-engineconnmanager:9102", instanceId.toLowerCase.indexOf(applicationName.toLowerCase) will return 0.
@lunescode lunescode changed the title bug: when hostname start with applicationName, will cause parse faile… bugFix: when hostname start with applicationName, will cause parse faile… Oct 29, 2021
Copy link
Contributor

@peacewong peacewong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@peacewong peacewong merged commit 7d00aea into apache:dev-1.0.3 Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants