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 potential deadlock in UI when saving #8606

Merged
merged 1 commit into from
Oct 19, 2022
Merged

Conversation

droidmonkey
Copy link
Member

This was noted as a problem in several issues and it finally occurred to me and I traced it to the fact that a timing issue sometimes allowed the file watcher to trigger a "file changed" alert right when saving starts. I fixed this by moving where the mutex lock is made for saving and preventing database reload during a save operation.

Testing strategy

Tried to replicate the problem and could not with the fixes in place.

Type of change

  • ✅ Bug fix (non-breaking change that fixes an issue)

This was noted as a problem in several issues and it finally occurred to me and I traced it to the fact that a timing issue sometimes allowed the file watcher to trigger a "file changed" alert right when saving starts. I fixed this by moving where the mutex lock is made for saving and preventing database reload during a save operation.
@droidmonkey droidmonkey added crash 💥 pr: backport pending Pull request yet to be backported to a previous release labels Oct 18, 2022
@droidmonkey droidmonkey added this to the v2.7.2 milestone Oct 18, 2022
@droidmonkey droidmonkey requested a review from phoerious October 18, 2022 22:28
@codecov-commenter
Copy link

codecov-commenter commented Oct 18, 2022

Codecov Report

Base: 64.26% // Head: 64.27% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (a955225) compared to base (5e9fa18).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8606      +/-   ##
===========================================
+ Coverage    64.26%   64.27%   +0.01%     
===========================================
  Files          341      341              
  Lines        44297    44298       +1     
===========================================
+ Hits         28466    28470       +4     
+ Misses       15831    15828       -3     
Impacted Files Coverage Δ
src/core/Database.cpp 83.77% <100.00%> (+0.03%) ⬆️
src/gui/DatabaseWidget.cpp 61.33% <100.00%> (+0.13%) ⬆️
src/core/FileWatcher.cpp 87.95% <0.00%> (+1.20%) ⬆️

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

@droidmonkey droidmonkey merged commit e180980 into develop Oct 19, 2022
@droidmonkey droidmonkey deleted the fix/stuck-saving branch October 19, 2022 11:02
@droidmonkey droidmonkey added pr: backported Pull request backported to previous release and removed pr: backport pending Pull request yet to be backported to a previous release labels Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash 💥 pr: backported Pull request backported to previous release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants