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

fix: (mod-service)Use concurrent read cache #10965

Merged
merged 3 commits into from
Jan 14, 2024

Conversation

Neeharika-Sompalli
Copy link
Member

@Neeharika-Sompalli Neeharika-Sompalli commented Jan 12, 2024

Root cause is the use of a HashMap readCache in ReadableKVStateBase results a race between (1) thread A that is trying to get an already-read key and (2) thread B that is trying to add a newly-read key and hence resizing the HashMap. This can lead to ISS.

To solve the issue used ConcurrentHashMap or SynchronizedMap instead of HashMap for readCache. Since we want to store null values in readCache if the entity doesn't exist in state, and ConcurrentHashMap doesn't allow null values decided to use SynchronizedMap.

This will be changed to use a Marker object instead of null value in the future based on performance testing.

Copy link

github-actions bot commented Jan 13, 2024

Node: HAPI Test (Node Death Reconnect) Results

1 tests  ±0   1 ✔️ ±0   5m 50s ⏱️ +28s
1 suites ±0   0 💤 ±0 
1 files   ±0   0 ±0 

Results for commit fa478b2. ± Comparison against base commit cca3e1c.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jan 13, 2024

Node: HAPI Test (Restart) Results

1 tests  ±0   1 ✔️ ±0   4m 54s ⏱️ +8s
1 suites ±0   0 💤 ±0 
1 files   ±0   0 ±0 

Results for commit fa478b2. ± Comparison against base commit cca3e1c.

♻️ This comment has been updated with latest results.

@Neeharika-Sompalli Neeharika-Sompalli changed the title Use concurrent read cache fix: (mod-service)Use concurrent read cache Jan 13, 2024
Copy link

github-actions bot commented Jan 13, 2024

Node: HAPI Test (Token) Results

189 tests  ±0   188 ✔️ +1   20m 5s ⏱️ -26s
  13 suites ±0       0 💤 ±0 
  13 files   ±0       1  - 1 

For more details on these failures, see this check.

Results for commit fa478b2. ± Comparison against base commit cca3e1c.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jan 13, 2024

Node: Unit Test Results

    2 292 files  ±0      2 292 suites  ±0   47m 5s ⏱️ - 3m 47s
118 791 tests ±0  118 752 ✔️ ±0  39 💤 ±0  0 ±0 
127 314 runs  ±0  127 275 ✔️ ±0  39 💤 ±0  0 ±0 

Results for commit fa478b2. ± Comparison against base commit cca3e1c.

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Jan 13, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (688f3d5) 63.26% compared to head (fa478b2) 63.27%.
Report is 4 commits behind head on develop.

Files Patch % Lines
...platform/state/address/AddressBookInitializer.java 75.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #10965      +/-   ##
=============================================
+ Coverage      63.26%   63.27%   +0.01%     
- Complexity     31301    31315      +14     
=============================================
  Files           3390     3390              
  Lines         137447   137483      +36     
  Branches       14405    14405              
=============================================
+ Hits           86951    86996      +45     
+ Misses         46906    46901       -5     
+ Partials        3590     3586       -4     

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

Copy link

github-actions bot commented Jan 13, 2024

Node: HAPI Test (Crypto) Results

210 tests  ±0   210 ✔️ ±0   22m 49s ⏱️ -29s
  22 suites ±0       0 💤 ±0 
  22 files   ±0       0 ±0 

Results for commit fa478b2. ± Comparison against base commit cca3e1c.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jan 13, 2024

Node: E2E Test Results

    1 files  ±    0      1 suites  ±0   23m 54s ⏱️ + 23m 54s
311 tests +310  311 ✔️ +311  0 💤 ±0  0  - 1 
333 runs  +332  333 ✔️ +333  0 💤 ±0  0  - 1 

Results for commit fa478b2. ± Comparison against base commit cca3e1c.

This pull request removes 1 and adds 311 tests. Note that renamed tests count towards both.
EndToEndTests ‑ initializationError
EndToEndTests ‑ ADDRESS_BOOK_CONTROLCanUpdateADDRESS_BOOK
EndToEndTests ‑ ADDRESS_BOOK_CONTROLCanUpdateNODE_DETAILS
EndToEndTests ‑ AccountsGetPayerRecordsIfSoConfigured
EndToEndTests ‑ Acct57CanMakeSmallChanges
EndToEndTests ‑ Acct57CantMakeLargeChanges
EndToEndTests ‑ AddingSignaturesToExecutedTxFails
EndToEndTests ‑ AddingSignaturesToExecutedTxFailsWithLongTermEnabled
EndToEndTests ‑ AddingSignaturesToNonExistingTxFails
EndToEndTests ‑ AddingSignaturesToNonExistingTxFailsWithLongTermEnabled
EndToEndTests ‑ AddressAliasIdFuzzing
…

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jan 13, 2024

Node: HAPI Test (Misc) Results

423 tests  ±0   409 ✔️ ±0   34m 4s ⏱️ - 1m 8s
  73 suites ±0     14 💤 ±0 
  73 files   ±0       0 ±0 

Results for commit fa478b2. ± Comparison against base commit cca3e1c.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jan 13, 2024

Node: HAPI Test (Time Consuming) Results

20 tests  ±0   20 ✔️ ±0   53m 44s ⏱️ -7s
  2 suites ±0     0 💤 ±0 
  2 files   ±0     0 ±0 

Results for commit fa478b2. ± Comparison against base commit cca3e1c.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jan 13, 2024

Node: HAPI Test (Smart Contract) Results

445 tests  ±0   444 ✔️ +1   59m 24s ⏱️ - 5m 1s
  52 suites ±0       0 💤 ±0 
  52 files   ±0       1  - 1 

For more details on these failures, see this check.

Results for commit fa478b2. ± Comparison against base commit cca3e1c.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jan 13, 2024

Node: Integration Test Results

    5 files  ±0      5 suites  ±0   1h 6m 22s ⏱️ -3s
318 tests ±0  318 ✔️ ±0  0 💤 ±0  0 ±0 
330 runs  ±0  330 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit fa478b2. ± Comparison against base commit cca3e1c.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@tinker-michaelj tinker-michaelj left a comment

Choose a reason for hiding this comment

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

LGTM, ty @Neeharika-Sompalli !

@Neeharika-Sompalli Neeharika-Sompalli merged commit 284dd7b into develop Jan 14, 2024
45 of 55 checks passed
@Neeharika-Sompalli Neeharika-Sompalli deleted the use-concurrent-read-cache branch January 14, 2024 02:18
timo0 pushed a commit that referenced this pull request Jan 22, 2024
Signed-off-by: Michael Tinker <[email protected]>
Co-authored-by: Michael Tinker <[email protected]>
Signed-off-by: Timo Brandstätter <[email protected]>
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