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

[SCB-2351] Optimize the ping method #2626

Merged
merged 4 commits into from
Oct 30, 2021
Merged

[SCB-2351] Optimize the ping method #2626

merged 4 commits into from
Oct 30, 2021

Conversation

five111
Copy link
Contributor

@five111 five111 commented Oct 26, 2021

When there are multiple endpoints, ping only the first one may cause the available services to be defined as unavailable
#2624

When there are multiple endpoints, ping only the first one may cause the available services to be defined as unavailable
@fanjiwang1992 fanjiwang1992 linked an issue Oct 26, 2021 that may be closed by this pull request
miss logger
@codecov-commenter
Copy link

codecov-commenter commented Oct 27, 2021

Codecov Report

Merging #2626 (43b49d2) into master (3286fa4) will increase coverage by 0.01%.
The diff coverage is 88.88%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2626      +/-   ##
============================================
+ Coverage     77.72%   77.74%   +0.01%     
  Complexity     1429     1429              
============================================
  Files          1598     1598              
  Lines         42652    42657       +5     
  Branches       3591     3592       +1     
============================================
+ Hits          33151    33162      +11     
+ Misses         8000     7996       -4     
+ Partials       1501     1499       -2     
Impacted Files Coverage Δ
...istry/consumer/SimpleMicroserviceInstancePing.java 92.30% <88.88%> (+14.52%) ⬆️
.../servicecomb/registry/discovery/DiscoveryTree.java 100.00% <0.00%> (+3.50%) ⬆️
...config/kie/client/model/ConfigurationsRequest.java 21.05% <0.00%> (+21.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3286fa4...43b49d2. Read the comment docs.


/**
* Simple implementation of .MicroserviceInstancePing using telnet
*/
public class SimpleMicroserviceInstancePing implements MicroserviceInstancePing {
private static final Logger LOGGER = LoggerFactory.getLogger(SimpleMicroserviceInstancePing.class);
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. use etc/*.xml code formatter formate code
  2. create a JIRA issue and submit a PR with JIRA id, see other PRs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done, but I'm not sure if I did it right

s.connect(new InetSocketAddress(ipPort.getHostOrIp(), ipPort.getPort()), 3000);
return true;
} catch (IOException e) {
LOGGER.warn("IOException, probable ping instance failed endpoint is {}", endpoint);
Copy link
Contributor

Choose a reason for hiding this comment

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

"ping instance {} endpoint {} failed", instanceid, endpoint

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@five111 five111 changed the title Optimize the ping method [SCB-2351]Optimize the ping method Oct 27, 2021
@five111 five111 changed the title [SCB-2351]Optimize the ping method [SCB-2351] Optimize the ping method Oct 27, 2021
use intellij-java-google-style.xml format code and change log
add UT for ping method changed
@liubao68 liubao68 merged commit eacfbf6 into apache:master Oct 30, 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.

服务发现时,微服务可用性判断不合理
3 participants