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

SymlinkAndCleanup - make cleanup asynchronous and #163

Open
ctheune opened this issue Dec 19, 2023 · 9 comments
Open

SymlinkAndCleanup - make cleanup asynchronous and #163

ctheune opened this issue Dec 19, 2023 · 9 comments
Assignees

Comments

@ctheune
Copy link
Contributor

ctheune commented Dec 19, 2023

At least one customer has been bitten by the fact that cleanups may take a very long time.

The cleanup IMHO should spawn a systemd-run job for the rm -rf and limit IOPS to something like 100 iops/s to ensure the cleanup job doesn't overload the system.

@EdwardBock
Copy link

Any news here?

@ctheune
Copy link
Contributor Author

ctheune commented Feb 29, 2024

@elikoga could we prioritize this?

@elikoga
Copy link
Member

elikoga commented Feb 29, 2024

Sure. As far as I undestand, we want to make what happens in this loop:

for el in self._list_removals():
batou.output.annotate("Removing: {}".format(el))
try:
if os.path.isdir(el):
shutil.rmtree(el)
else:
os.remove(el)
except OSError as e:
batou.output.error(f'Failed to remove "{el}": {e.strerror}')
pass

            for el in self._list_removals():
                batou.output.annotate("Removing: {}".format(el))
                try:
                    if os.path.isdir(el):
                        shutil.rmtree(el)
                    else:
                        os.remove(el)
                except OSError as e:
                    batou.output.error(f'Failed to remove "{el}": {e.strerror}')
                    pass

Be defered to running in the background using systemd-run

@ctheune
Copy link
Contributor Author

ctheune commented Mar 1, 2024

Yup.

@EdwardBock
Copy link

When can we use this?

@EdwardBock
Copy link

Any news here?

@ctheune ctheune transferred this issue from flyingcircusio/batou Apr 23, 2024
@EdwardBock
Copy link

I'm back. Any news?

@elikoga
Copy link
Member

elikoga commented Jul 24, 2024

Yes, the use_systemd_run_async_cleanup option on SymlinkAndCleanup added in #159 has this behaviour

@EdwardBock
Copy link

We tested this. This was not working. @zagy knows more about the problems as he was talking to my colleague.

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

No branches or pull requests

3 participants