Skip to content

pipeline-manager: rust compilation cleans up target#6410

Open
snkas wants to merge 1 commit into
mainfrom
compiler-cleanup
Open

pipeline-manager: rust compilation cleans up target#6410
snkas wants to merge 1 commit into
mainfrom
compiler-cleanup

Conversation

@snkas
Copy link
Copy Markdown
Contributor

@snkas snkas commented Jun 5, 2026

The Rust compilation cleanup now checks whether the disk on which it takes place it about to reach a usage threshold:

  • If it exceeds 70%, a warning is printed.
  • If it exceeds 90%, the target directory is removed if it is 5% or more of the total disk space. The compiler server is restarted if the form factor supports it.

PR information

  • Manually tested
  • No backward incompatible changes

The Rust compilation cleanup now checks whether the disk on which it
takes place it about to reach a usage threshold:

- If it exceeds 70%, a warning is printed.
- If it exceeds 90%, the `target` directory is removed if it is 5% or
  more of the total disk space. The compiler server is restarted if the
  form factor supports it.

Signed-off-by: Simon Kassing <simon.kassing@feldera.com>
Copy link
Copy Markdown
Contributor

@gz gz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome;

what's the impact on restarting things when someone has multiple compiler server? (IIRC server-0 is special in this model -- wonder what if it receives a binary during restart?)

RustCompilationCleanupError::Utility(e) => {
error!("Rust worker {worker_id}: compilation cleanup failed: utility error occurred: {e}");
}
RustCompilationCleanupError::TargetCleared => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you want to detect the case when even one compilation on a clean disk fails and you should not retry?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, so I added a first logic that generally makes sense. I agree that the assumptions can be made tighter, will do more testing before merging this PR.


// (2) For each possible compilation profile, clean up their target artifacts
// (2) If the disk that the target directory resides on has reached a certain threshold
// the entire target directory will get removed. There is not a cleaner way currently to
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a -> no

// (2) For each possible compilation profile, clean up their target artifacts
// (2) If the disk that the target directory resides on has reached a certain threshold
// the entire target directory will get removed. There is not a cleaner way currently to
// more fine-combined clean up old dependencies.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fine-combined?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fine-grained? targeted?

I made a verb out of "go over it with a fine tooth comb", but the analogy actually is not correct either. Will change it

@snkas
Copy link
Copy Markdown
Contributor Author

snkas commented Jun 5, 2026

what's the impact on restarting things when someone has multiple compiler server? (IIRC server-0 is special in this model -- wonder what if it receives a binary during restart?)

It'll need some more downstream testing before I merge this PR.

Restarting is the same as it temporarily going down (it goes through continuous cycle of compile -> cleanup -> compile -> cleanup -> ...). Pipeline binaries are not stored in target directory, so cleanup of that should not be affected.

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.

3 participants