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

rclone serve restic processes left behind #1006

Closed
kapitainsky opened this issue Jan 14, 2024 · 6 comments
Closed

rclone serve restic processes left behind #1006

kapitainsky opened this issue Jan 14, 2024 · 6 comments
Labels
A-backends Area: Related to backends in `rustic-core` C-bug Category: Something isn't working as expected

Comments

@kapitainsky
Copy link
Contributor

I have noticed that after playing with rustic I always have rclone serve restic processes left behind and running, e.g.:

$ ps -ef | grep rclone
  501 25941     1   0 Fri05PM ??         0:13.96 rclone serve restic onedrive:restic-VM --addr localhost:0
  501  5407     1   0 Thu09PM ttys003    2:34.60 rclone serve restic OD01-ENC:restic-test --addr localhost:0
  501 12210     1   0 Fri07AM ttys003    0:15.61 rclone serve restic OD01-ENC:restic-test --addr localhost:0

It would mean that sometimes when rustic is terminated it does not stop rclone instance it is using.

I have not identified yet reproducible conditions but I see it daily so it is not something exceptional.

@github-actions github-actions bot added the S-triage Status: Waiting for a maintainer to triage this issue/PR label Jan 14, 2024
@aawsome
Copy link
Member

aawsome commented Jan 14, 2024

duplicate of rustic-rs/rustic_core#22

Actually I cannot yet explain why this is happening. But I can confirm that I also had left-over rclone instances. But it seem I'm not having them for my regular scheduled backups. So my theory is that either backup is not affected or that systemd-scheduled runs are not affected...

@aawsome
Copy link
Member

aawsome commented Jan 14, 2024

Actually, I thought that when the rclone backend is dropped, it will always call a kill on the created subprocess. Technically the Child process is wrapped in an Arc and kill is called just before the containing Child is dropped. For panicking rustic runs, this could cause left-over child processes. But it seems, we also have this for normally terminating runs...Maybe the Arc gets never dropped? In this case, rustic-rs/rustic_core#73 might help as with this PR, a backend no longer needs to be Copy and we can remove the Arc.

About systemd runs. IIRC, systemd would take care about subprocesses and also kill them - this would explain why this is not observable with systemd.

@aawsome
Copy link
Member

aawsome commented Jan 17, 2024

I did some other tests and can say that I can reproduce the behavior when I manually run rustic check.
Now I'll try if #73 fixed that...

@aawsome
Copy link
Member

aawsome commented Jan 17, 2024

Unfortunately, #73 didn't fix it.. I'll have to take a deeper look into where things could go wrong...

@aawsome aawsome added C-bug Category: Something isn't working as expected A-backends Area: Related to backends in `rustic-core` and removed S-triage Status: Waiting for a maintainer to triage this issue/PR labels Jan 27, 2024
@aawsome
Copy link
Member

aawsome commented Jan 27, 2024

I think I found the reason, see rustic-rs/rustic_core#22

@aawsome
Copy link
Member

aawsome commented Jan 28, 2024

closed via rustic-rs/rustic_core#139

@aawsome aawsome closed this as completed Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backends Area: Related to backends in `rustic-core` C-bug Category: Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

2 participants