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
Prevent deadlocks on components and locale updates #15535
Conversation
Codecov ReportBase: 61.29% // Head: 50.62% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #15535 +/- ##
===========================================
- Coverage 61.29% 50.62% -10.68%
===========================================
Files 1355 297 -1058
Lines 33498 10474 -23024
Branches 6455 2324 -4131
===========================================
- Hits 20532 5302 -15230
+ Misses 11143 4272 -6871
+ Partials 1823 900 -923
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
users and permisisons also has one don't know if this should be in this pr or a different one? strapi/packages/plugins/users-permissions/server/services/role.js Lines 138 to 143 in 70f188c
the #12346 pr also would fix this |
There are also some other uses of Promise.all() in the entity-service and i18n plugin: strapi/packages/core/strapi/lib/services/entity-service/index.js Lines 253 to 263 in 62e3f93
strapi/packages/plugins/i18n/server/migrations/field/migrate.js Lines 9 to 23 in bd201cd
Could these lead to deadlocks? And if not should we change the syntax anyway for consistency? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM as a quick fix.
But I'm persuaded that we should find a way to do ops in parallel as this can decrease performances over huge sets of data. Also, I think we need to mention this point in the release patch note.
Maybe we can put this element to be addressed in the v5 architecture spec process.
Thank you for your reviews! Yes, we let some We just did another PR on the same part of the code to fix performance issues and it appears... it may also fix the deadlocks! So we would like to first merge #15554 and see if it fixes the deadlocks issues for users before merging this PR :) |
What does it do?
It uses sequential updates instead of Promise.all to avoid deadlocks
Why is it needed?
Because otherwise it can prevent to create a new locale for an entity or to save an entry with components
How to test it?
It's very difficult to test it as the deadlocks are random. Contact @Marc-Roig so he can show you how to :p
Related issue(s)/PR(s)
#15202