Skip to content

Backup process fails when device goes to sleep mode at 1% progress and awakes five seconds later #2813

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

Closed
gerryfrancis opened this issue Nov 3, 2021 · 8 comments
Labels
bug Something is not working

Comments

@gerryfrancis
Copy link
Collaborator

  • Android version:
    Android 11.

  • Device:
    Fairphone FP2 (Lineage OS 18.1 build RQ3A.210705.001 from 2021-10-29).

  • Delta Chat version:
    1.23.0 (latest nightly build).

  • Expected behavior:
    The backup process continues when the device awakes from sleep mode.

  • Actual behavior:
    The backup process is aborted after the device awakes from sleep mode, namely at 1% of the progress, and the message cannot export backup, IO already running appears.

  • Steps to reproduce the problem:
    -- Start a backup ("Settings" -> "Chats and Media" -> "Back Up Chats to External Storage" -> "Start Backup").
    -- Immediately after the backup process has started, put the device in sleep mode by using the power switch.
    -- Wait five seconds.
    -- Awake the device from sleep mode by using the power switch and go back to Delta Chat, then wait 30 seconds. (Result: The backup process is aborted.)

  • Screenshots:
    grafik

  • Logs:
    deltachat-log-20211103-115749.txt

@Hocuri
Copy link
Collaborator

Hocuri commented Nov 15, 2021

Seems like the problem is that during the backup, ForegroundDetector does startIo().

We should somehow prevent starting IO during IMEX operations (and probably also during configure). This could somehow be integrated into alloc_ongoing().

@Hocuri Hocuri transferred this issue from deltachat/deltachat-android Nov 15, 2021
@r10s r10s added the bug Something is not working label Mar 8, 2022
@link2xt
Copy link
Collaborator

link2xt commented Feb 21, 2023

Context.start_io() should refuse to create a Scheduler if there is an ongoing process.

Ideally InnerContext.scheduler variable should become a variant of InnerContext.running_state enum, so it is impossible to have an ongoing process and running scheduler on a type system level.

It is also important for #4007 that we cannot start the scheduler while serving a backup.

@gerryfrancis
Copy link
Collaborator Author

The issue no longer occurs in the latest nightly build from today, thank you! Shall we close here?

@link2xt
Copy link
Collaborator

link2xt commented Feb 22, 2023

I am pretty sure it is not fixed, as in start_io() still can start the scheduler in the middle of import/export.

@link2xt
Copy link
Collaborator

link2xt commented Mar 19, 2023

Likely fixed by #4138, but need to double-check

@gerryfrancis
Copy link
Collaborator Author

@link2xt I cannot reproduce the issue anymore, can you confirm? Many thanks!

@link2xt
Copy link
Collaborator

link2xt commented May 5, 2023

I'd close it, we can always reopen or open a new issue if someone reports similar problems.

@gerryfrancis
Copy link
Collaborator Author

@link2xt Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working
Projects
None yet
Development

No branches or pull requests

4 participants