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(model-server): deadlock caused by non-existing lock ordering #1235

Merged
merged 4 commits into from
Dec 12, 2024

Conversation

slisson
Copy link
Member

@slisson slisson commented Dec 8, 2024

Replaced the fine-grained entry based locking strategy (which would require lock ordering) of Ignite by a single ReentrantReadWriteLock similar to how MPS does it.

This only works if there is a single model-server instance, but there is an open issue for supporting multiple instances anyway (https://issues.modelix.org/issue/MODELIX-344/Support-multiple-model-server-instances), meaning it's currently already unsupported for other reasons.

A IgniteSemaphore is now used to implement a cluster-wide read/write lock.

Copy link
Contributor

github-actions bot commented Dec 8, 2024

Test Results

  193 files    193 suites   36m 14s ⏱️
1 075 tests 1 066 ✅ 9 💤 0 ❌
1 085 runs  1 076 ✅ 9 💤 0 ❌

Results for commit cfebf70.

♻️ This comment has been updated with latest results.

@slisson slisson marked this pull request as draft December 8, 2024 18:58
@slisson slisson force-pushed the MODELIX-1050-Deadlock-in-model-server branch 2 times, most recently from 0bd26e3 to a35fd24 Compare December 9, 2024 14:27
Copy link
Contributor

github-actions bot commented Dec 9, 2024

JVM coverage report

Overall Project 54.53% -0.69%
Files changed 70.68%

File Coverage
HealthApiImpl.kt 99.01% -0.99% 🍏
InMemoryStoreClient.kt 95.28% -2.47% 🍏
IStoreClient.kt 92.92% 🍏
IRepositoriesManager.kt 92.16% -1.96% 🍏
TransactionLocks.kt 90.96% -9.04% 🍏
DiffView.kt 89.45% -2.33%
KeyValueLikeModelServer.kt 87.86% -0.93% 🍏
RepositoriesManager.kt 83.52% -2.06% 🍏
ModelReplicationServer.kt 83.28% -1.2% 🍏
IgniteStoreClient.kt 82.61% -11.73%
StoreManager.kt 76.06% -4.26% 🍏
IGenericStoreClient.kt 71.17% -28.83%
ContentExplorer.kt 65.13% -8.02%
IdsApiImpl.kt 64.66% -17.24%
IImmutableStore.kt 63.01% -36.99%
StoreClientAdapter.kt 61.11% -33.89%
StoreClientAsKeyValueStore.kt 58.54% 🍏
StoreClientAsAsyncStore.kt 57.14% -1.14%
Main.kt 18.97% -4.19%
RepositoryOverview.kt 15.65% -20.05%
HistoryHandler.kt 0% -7.02%
DumpStore.kt 0% -58.38%

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

detekt found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@slisson slisson force-pushed the MODELIX-1050-Deadlock-in-model-server branch from a35fd24 to ecb268a Compare December 9, 2024 15:05
@slisson slisson marked this pull request as ready for review December 9, 2024 15:26
@slisson slisson requested a review from a team as a code owner December 9, 2024 15:26
@slisson slisson force-pushed the MODELIX-1050-Deadlock-in-model-server branch 2 times, most recently from b9ffc38 to cdbbae6 Compare December 9, 2024 18:50
@slisson slisson force-pushed the MODELIX-1050-Deadlock-in-model-server branch 4 times, most recently from 09c1af7 to d17a384 Compare December 12, 2024 14:25
@slisson slisson force-pushed the MODELIX-1050-Deadlock-in-model-server branch from d17a384 to ed9bd6d Compare December 12, 2024 14:26
@slisson slisson enabled auto-merge December 12, 2024 14:27
@slisson slisson requested a review from odzhychko December 12, 2024 14:28
Copy link
Contributor

@odzhychko odzhychko left a comment

Choose a reason for hiding this comment

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

Only found one issue in DiffView. Everything else looks good.

@slisson slisson merged commit f3b4e9f into main Dec 12, 2024
21 checks passed
@slisson slisson deleted the MODELIX-1050-Deadlock-in-model-server branch December 12, 2024 15:52
@slisson
Copy link
Member Author

slisson commented Dec 13, 2024

🎉 This PR is included in version 10.2.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants