rdiff-backup-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Resource deadlock avoided on MacOS with OneDrive


From: Patrik Dufresne
Subject: Re: Resource deadlock avoided on MacOS with OneDrive
Date: Wed, 25 Sep 2024 16:20:02 -0400

Hi,

In case anyone encounters the same issue, I’m sharing my findings related
to running a backup of OneDrive folders on macOS.

First off, some files that should be fetched from OneDrive's cloud storage
fail to load. Any application attempting to read these files ends up
blocked indefinitely. Upon further investigation, I found that the process
gets stuck in the read() function without throwing any exceptions or
errors. This affects rdiff-backup as well, which similarly freezes when
trying to read these files.

It seems there’s a bug with OneDrive. A partial workaround is to enable the
Full Sync option in OneDrive's preferences. However, even this doesn't
resolve the issue for all files. After enabling Full Sync, I tried closing
and reopening OneDrive, but the problem persisted for certain files.

To help troubleshoot, I created a shell script that goes through each file
and attempts to read the first few bytes to check whether the file is
available. This forces OneDrive to download the files locally. I’ve
attached the script to this email for reference.

As a potential fix for rdiff-backup, I suggest checking if the file's disk
size is zero while its expected size is greater than zero. This is a good
indicator that the file hasn’t been downloaded. If the file is not present
on disk, a possible solution would be to attempt reading the file's content
with a timeout. A delay of about 20 seconds seems reasonable. Here’s a
basic example:

def read_with_timeout(fp, num_bytes timeout=20):
    signal.signal(signal.SIGALRM, timeout_handler)
    signal.alarm(timeout)  # Set the alarm for timeout seconds
    try:
        data = fp.read(num_bytes)
        signal.alarm(0)  # Cancel the alarm if successful
        return data
    except TimeoutException as e:
        raise e

Long story short, avoid using OneDrive on MacOS ! :D


Le ven. 20 sept. 2024, à 07 h 55, Patrik Dufresne <patrik@ikus-soft.com> a
écrit :

> Hello,
>
> I recently configured a new backup on MacOS with OneDrive. It's not the
> first time I installed a backup of OneDrive, but usually it's on a Windows
> OS, not MacOS. Rdiff-backup seems to be running into trouble because the
> file is not present on the disk.
> https://www.reddit.com/r/Arqbackup/comments/t9eggc/solution_to_resource_deadlock_avoided_error/
>
> Here the exception:
>
> WARNING: Exception '[Errno 11] Resource deadlock avoided' raised of class 
> '<class 'BlockingIOError'>':
>   File "rdiff_backup/robust.py", line 94, in check_common_error
>   File "rdiff_backup/rpath.py", line 1586, in copy
>   File "rdiff_backup/rpath.py", line 1620, in copy_reg_file
>   File "rdiff_backup/rpath.py", line 1152, in write_from_fileobj
>   File "rdiff_backup/rpath.py", line 1537, in copyfileobj
>   File "rdiff_backup/rpath.py", line 1514, in read
>   File "rdiff_backup/iterfile.py", line 495, in read
>
> * Sending back exception '[Errno 11] Resource deadlock avoided' of type 
> <class 'BlockingIOError'> with traceback   File "rdiff_backup/connection.py", 
> line 509, in _answer_request
>   File "rdiff_backup/backup.py", line 197, in patch
>   File "rdiff_backup/rorpiter.py", line 146, in __call__
>   File "rdiff_backup/backup.py", line 600, in fast_process_file
>   File "rdiff_backup/backup.py", line 655, in _patch_to_temp
>   File "rdiff_backup/backup.py", line 702, in _patch_snapshot_to_temp
>   File "rdiff_backup/robust.py", line 94, in check_common_error
>   File "rdiff_backup/rpath.py", line 1586, in copy
>   File "rdiff_backup/rpath.py", line 1620, in copy_reg_file
>   File "rdiff_backup/rpath.py", line 1152, in write_from_fileobj
>   File "rdiff_backup/rpath.py", line 1537, in copyfileobj
>   File "rdiff_backup/rpath.py", line 1514, in read
>   File "rdiff_backup/iterfile.py", line 495, in read
>
>
> Anybody ran into this issue with rdiff-backup ? I'm kinda surprised it's
> failing like this while trying to read the file. I would expect the OS to
> trigger the download of the file if the file is offline when rdiff-backup
> starts reading the file.
>
> Your input are welcome
>
> --
> IKUS Software
> https://www.ikus-soft.com/
> 514-971-6442
> St-Colomban, QC J5K 1T9
>


-- 
IKUS Software
https://www.ikus-soft.com/
514-971-6442
St-Colomban, QC J5K 1T9


reply via email to

[Prev in Thread] Current Thread [Next in Thread]