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 crash on entering new log file after file size of 512kb reached #5603

Merged
merged 4 commits into from
Apr 21, 2023

Conversation

claucambra
Copy link
Collaborator

We are encountering a possible thread-unsafe race condition. Fix is to put this under the existing mutex.

@claucambra claucambra self-assigned this Apr 13, 2023
@mgallien
Copy link
Collaborator

/backport to stable-3.8

Copy link
Collaborator

@mgallien mgallien left a comment

Choose a reason for hiding this comment

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

deadlock

@codecov
Copy link

codecov bot commented Apr 13, 2023

Codecov Report

Merging #5603 (9c8b624) into master (38ae92b) will decrease coverage by 0.03%.
The diff coverage is 35.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5603      +/-   ##
==========================================
- Coverage   59.28%   59.26%   -0.03%     
==========================================
  Files         143      143              
  Lines       18445    18453       +8     
==========================================
+ Hits        10936    10937       +1     
- Misses       7509     7516       +7     
Impacted Files Coverage Δ
src/libsync/logger.h 61.53% <ø> (ø)
src/libsync/logger.cpp 28.57% <35.00%> (+0.41%) ⬆️

... and 3 files with indirect coverage changes

@mgallien mgallien force-pushed the bugfix/fix-log-crash branch from 8e48fa2 to e70c51e Compare April 18, 2023 21:32
@mgallien mgallien self-requested a review April 19, 2023 08:30
@mgallien mgallien force-pushed the bugfix/fix-log-crash branch from e70c51e to 210363d Compare April 19, 2023 08:31
@mgallien mgallien force-pushed the bugfix/fix-log-crash branch from 210363d to 7af3962 Compare April 20, 2023 13:10
claucambra and others added 4 commits April 21, 2023 10:32
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
separate public methods that must lock and private methods that must not
lock

will avoid deadlock or unprotected accesses

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
@mgallien mgallien force-pushed the bugfix/fix-log-crash branch from 7af3962 to 9c8b624 Compare April 21, 2023 08:32
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell B 7 Code Smells

27.1% 27.1% Coverage
0.0% 0.0% Duplication

@nextcloud-desktop-bot
Copy link

AppImage file: nextcloud-PR-5603-9c8b624ef7350f649e06e0f16249b0e4e800b4f1-x86_64.AppImage

To test this change/fix you can simply download above AppImage file and test it.

Please make sure to quit your existing Nextcloud app and backup your data.

@mgallien mgallien merged commit d661bdb into master Apr 21, 2023
@mgallien mgallien deleted the bugfix/fix-log-crash branch April 21, 2023 10:15
@backportbot-nextcloud
Copy link

The backport to stable-3.8 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable-3.8
git pull origin/stable-3.8

# Create the new backport branch
git checkout -b fix/foo-stable-3.8

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable-3.8

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

@mgallien
Copy link
Collaborator

/backport to stable-3.8

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.

4 participants