Skip to content

Conversation

@zrlw
Copy link
Contributor

@zrlw zrlw commented Jun 13, 2025

What is the purpose of the change?

Fix the codes that still use ConcurrentHashMap#computeIfAbsent which might have performance issue and deadlock risk,
see details at

  1. ConcurrentHashMapUtils无法解决jdk8的循环bug
  2. dubbo.metrics publishEvent blocked on ConcurrentHashMap.computeIfAbsent

Checklist

  • Make sure there is a GitHub_issue field for the change.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Make sure gitHub actions can pass. Why the workflow is failing and how to fix it?

@codecov-commenter
Copy link

codecov-commenter commented Jun 13, 2025

Codecov Report

Attention: Patch coverage is 97.63780% with 3 lines in your changes missing coverage. Please review.

Project coverage is 60.96%. Comparing base (4f5ca88) to head (ade6e29).

Files with missing lines Patch % Lines
.../registry/zookeeper/ZookeeperServiceDiscovery.java 83.33% 2 Missing ⚠️
...apache/dubbo/common/serialization/ClassHolder.java 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                3.3   #15456      +/-   ##
============================================
+ Coverage     60.94%   60.96%   +0.01%     
+ Complexity    11454    11453       -1     
============================================
  Files          1888     1888              
  Lines         86368    86377       +9     
  Branches      12958    12958              
============================================
+ Hits          52640    52660      +20     
+ Misses        28295    28282      -13     
- Partials       5433     5435       +2     
Flag Coverage Δ
integration-tests-java17 33.11% <82.67%> (+<0.01%) ⬆️
integration-tests-java8 33.14% <82.67%> (+<0.01%) ⬆️
samples-tests-java17 31.43% <79.52%> (-0.01%) ⬇️
samples-tests-java8 29.38% <75.59%> (+0.02%) ⬆️
unit-tests 58.88% <94.48%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zrlw zrlw force-pushed the 3.3-Optimized-useConcurrentHashMapUtils2AvoidDeadlock branch 3 times, most recently from 036833f to 1ed3c71 Compare June 13, 2025 12:57
@zrlw zrlw changed the title [3.3] Replace ConcurrentHash#computeIfAbsent by ConcurrentHashMapUtils#computeIfAbsent for performance improvement and avoiding deadlock [3.3] Replace ConcurrentHashMap#computeIfAbsent by ConcurrentHashMapUtils#computeIfAbsent for performance improvement and avoiding deadlock Jun 13, 2025
@zrlw zrlw changed the title [3.3] Replace ConcurrentHashMap#computeIfAbsent by ConcurrentHashMapUtils#computeIfAbsent for performance improvement and avoiding deadlock [3.3] Replace ConcurrentHashMap#computeIfAbsent by ConcurrentHashMapUtils#computeIfAbsent for performance improvement and prevention of deadlock Jun 13, 2025
@zrlw
Copy link
Contributor Author

zrlw commented Jun 13, 2025

@oxsean PTAL

@zrlw zrlw force-pushed the 3.3-Optimized-useConcurrentHashMapUtils2AvoidDeadlock branch from 1ed3c71 to b90d29f Compare June 14, 2025 01:02
@zrlw zrlw changed the title [3.3] Replace ConcurrentHashMap#computeIfAbsent by ConcurrentHashMapUtils#computeIfAbsent for performance improvement and prevention of deadlock [3.3] Replace ConcurrentHashMap#computeIfAbsent for performance improvement and prevention of deadlock Jun 14, 2025
@zrlw zrlw force-pushed the 3.3-Optimized-useConcurrentHashMapUtils2AvoidDeadlock branch from b90d29f to 9fba6ef Compare June 14, 2025 01:44
@zrlw zrlw force-pushed the 3.3-Optimized-useConcurrentHashMapUtils2AvoidDeadlock branch from 9fba6ef to 2933103 Compare June 14, 2025 02:12
Copy link
Contributor

@oxsean oxsean left a comment

Choose a reason for hiding this comment

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

LGTM.

@zrlw zrlw merged commit 49e5c5e into apache:3.3 Jun 18, 2025
29 checks passed
@zrlw zrlw deleted the 3.3-Optimized-useConcurrentHashMapUtils2AvoidDeadlock branch June 18, 2025 23:22
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