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

Lock for updating po files #25

Closed
nijel opened this issue Apr 6, 2012 · 3 comments · Fixed by #3831
Closed

Lock for updating po files #25

nijel opened this issue Apr 6, 2012 · 3 comments · Fixed by #3831
Assignees
Labels
enhancement Adding or requesting a new feature.
Milestone

Comments

@nijel
Copy link
Member

nijel commented Apr 6, 2012

Once there is po scanning in progress, it might take some time. As the events for this might come in short intervals, it can quite easily happen that there more concurrent updates, basically doing same work multiple times. This should be avoided either by locking or by delegating such work to background process.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@nijel nijel mentioned this issue Apr 6, 2012
@nijel
Copy link
Member Author

nijel commented Oct 17, 2014

Also we should provide some feedback in the UI that the project is being updated.

@nijel
Copy link
Member Author

nijel commented May 2, 2020

The feedback in UI is already there, the locking is still missing. I did a quick research on this and I think we should implement:

  • Redis based locking per component, fallback to filesystem locks in case it is not available (we want to be ready for scaling here).
  • Delay update to Celery task in case one is already running, probably with some delay.
  • Not sure if retries should be used for Celery tasks, or use logic outlined above.

@nijel nijel self-assigned this May 7, 2020
nijel added a commit that referenced this issue May 7, 2020
This avoids several race conditions when running concurrent updates. In
case the lock can not be obtained, the update is scheduled in background
and retried until the lock can be obtained.

Fixes #25
Fixes WEBLATE-3RA
Fixes WEBLATE-3JC
Fixes WEBLATE-3QQ
Fixes WEBLATE-3QH
Fixes WEBLATE-3QG
Fixes WEBLATE-3NP
Fixes WEBLATE-3QD
Fixes WEBLATE-3QC
Fixes WEBLATE-3Q4
Fixes WEBLATE-3Q3
Fixes WEBLATE-3NM
@github-actions
Copy link

github-actions bot commented May 7, 2020

Thank you for your report, the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see similar problem, please open separate issue.
  • If you are happy with the outcome, consider supporting Weblate by donating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding or requesting a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant