Prevent the RpcClient cleanup thread from cleaning up the client object that is about to be used by eric-zc1 · Pull Request #78 · trpc-group/trpc-java · GitHub
Skip to content

Prevent the RpcClient cleanup thread from cleaning up the client object that is about to be used#78

Merged
wardseptember merged 1 commit into
trpc-group:masterfrom
eric-zc1:132-issue
Jan 15, 2025
Merged

Prevent the RpcClient cleanup thread from cleaning up the client object that is about to be used#78
wardseptember merged 1 commit into
trpc-group:masterfrom
eric-zc1:132-issue

Conversation

@eric-zc1

Copy link
Copy Markdown
Contributor
  1. RpcClientProxy的lastUsedNanos使volatile,避免多线程可见性不一致;
  2. 使用ConcurrentMap的compute,在返回之前updateLastUsedNanos,保证其他线程get的时候拿到的是都是已经更新过最后使用时间的

2. 使用ConcurrentMap的compute,在返回之前updateLastUsedNanos,保证其他线程get的时候拿到的是都是已经更新过最后使用时间的
@eric-zc1

Copy link
Copy Markdown
Contributor Author

@codecov

codecov Bot commented Jan 15, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.11985%. Comparing base (d5ad43f) to head (473a7bc).
Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@                  Coverage Diff                  @@
##                master         #78         +/-   ##
=====================================================
- Coverage     70.14323%   70.11985%   -0.02339%     
+ Complexity        4241        4239          -2     
=====================================================
  Files              437         437                 
  Lines            17105       17105                 
  Branches          1727        1727                 
=====================================================
- Hits             11998       11994          -4     
- Misses            3992        3995          +3     
- Partials          1115        1116          +1     
Files with missing lines Coverage Δ
...ent/trpc/core/cluster/RpcClusterClientManager.java 53.27869% <100.00000%> (ø)

... and 2 files with indirect coverage changes

@wardseptember wardseptember merged commit e7eccb0 into trpc-group:master Jan 15, 2025
@eric-zc1 eric-zc1 deleted the 132-issue branch December 18, 2025 02:34
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.

2 participants