-
Notifications
You must be signed in to change notification settings - Fork 199
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
RuntimeError: reentrant call inside <_io.BufferedWriter name=''> #1003
Comments
Exact same issue, but in my case it was a backup from one mount point to another, the log file was not included in anyway. Also if you take a look at the log file itself, the rsync command already exclude it What I find weird is the way the rsync command is composed (for reference, running as root with only include /mnt/data/, to /mnt/backup/). Why does it have to change the permissions? Edit: Weirdly enough a reboot solve the issue for me. |
I got the same issue as the downstream maintainer in fedora: |
I just had the exact same issue with the same backtrace, after backing up multiple terabytes of data over 24 hours. |
Still happening on a recent fedora version with the latest upstream backintime https://bugzilla.redhat.com/show_bug.cgi?id=2016628 |
Same error with Backintime 1.3.2 running in Manjaro. Trying to backup files from one USB drive onto another USB drive. |
There may be useful hints in the closed OpenSUSE bug 1188115. |
another crash on fedora https://bugzilla.redhat.com/show_bug.cgi?id=2150491 |
Reason for this bug
This is a known issue of Python3 and works as expected from the Python point-of-view ("won't fix") since this code is not reentrant: https://bugs.python.org/issue24283 Looking into the traceback I think this a non-deterministic bug in BiT that happens whenever BiT tries to write into the log file in the main thread while triggering a file buffer flush in another thread (via a "timer" signal) so excluding the BiT log file will not eliminate this RTE! Code that causes the bugThe snapshot logger establishes a signal handler that is called in regular time intervals to flush the log file (in another thread!): backintime/common/snapshotlog.py Line 117 in f7f28b5
A log entry is written in the main thread and the signal handler instructed to be called after 5 secs to flush the file buffer: backintime/common/snapshotlog.py Lines 195 to 196 in f7f28b5
After 5 secs the Line 1489 in f7f28b5
Whenever writing a snapshot log entry (snapshotlog.py#L195) is interrupted by the Proposed fix:The Python3 runtime will not support reentrance and BiT should flush the log every n seconds to make the progress visible and persist the up-to-date log file content even if BiT crashes. So the easiest fix is to catch this RTE in the Edit: Logging of this RTE is not reliable since it would cause another RTE of the same type ;-) I will prepare a PR to fix this. Consider excluding BiT files from the backupsBiT uses From what I see in the code Lines 184 to 189 in bff7aeb
the following folders should be excluded too by default (and manually as workaround for older versions of BiT):
Ignoring specific files kept open by BiT would be even better since ignoring the whole folder means that
are not contained in the backup 😲 This would require to add a positive list of all file names (or extensions) that are uses in the The default config can be changed here in the source code: Lines 132 to 135 in bff7aeb
|
FYI: I have fixed the bug and opened a separate issue as feature request (#1382) to exclude BiT files by default so that this issue can be closed now. |
Thanks a lot! I am really impressed by the new BiT team, please keep up the good work! |
With backintime (1.2.0) when you try to backup whole system (/ mount point) backup task fails with the following error:
Simple workaround in this case is to add backintime log file (e.g.
/root/.local/share/backintime/takesnapshot_.log
) to exclude list.Please review this case, maybe log file should be excluded (or handled in a special way), to avoid such issue.
The text was updated successfully, but these errors were encountered: