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

refactor: call system gc once instead of after each job cleanup iteration #91

Merged
merged 1 commit into from
Sep 30, 2022

Conversation

josegonzalez
Copy link
Contributor

When cleaning up a namespace, we previously:

  • purged the ignorable jobs
  • called system gc
  • called namespace deletion

This was performed for each namespace, causing more load on Nomad as it called GC potentially dozens of times.

Instead, we now purged all the ignorable jobs in each namespace, then call system gc, and finally delete all the underlying namespaces. This should cause less stress on the nomad cluster.

Additionally, if no jobs are found for a deletable namespace, skip the deletion logic completely (which makes the log output a bit cleaner).

druwadi
druwadi previously approved these changes Jul 25, 2022
…tion

When cleaning up a namespace, we previously:

- purged the ignorable jobs
- called system gc
- called namespace deletion

This was performed for each namespace, causing more load on Nomad as it called GC potentially dozens of times.

Instead, we now purged all the ignorable jobs in each namespace, _then_ call system gc, and finally delete all the underlying namespaces. This should cause less stress on the nomad cluster.

Additionally, if no jobs are found for a deletable namespace, skip the deletion logic completely (which makes the log output a bit cleaner).
@josegonzalez josegonzalez merged commit a160e91 into master Sep 30, 2022
@josegonzalez josegonzalez deleted the safer-cleanup branch September 30, 2022 21:27
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

Successfully merging this pull request may close these issues.

2 participants