-
Notifications
You must be signed in to change notification settings - Fork 557
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
Do safe preprocess optimizations. #4444
Conversation
jonathanmetzman
commented
Nov 26, 2024
- Don't unnecessarily list features about blobs other than names
- Memoize leak blacklist stuff.
- Properly skip cleanup.
1. Don't unnecessarily list features about blobs other than names 2. Memoize leak blacklist stuff. 3. Properly skip cleanup.
This has some of the changes from #4431 while I wait for a review. |
@@ -80,6 +80,8 @@ class AlreadyRunningError(Error): | |||
def cleanup_task_state(): | |||
"""Cleans state before and after a task is executed.""" | |||
# Cleanup stale processes. | |||
if not environment.is_tworker(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How bad is it if this codepath gets hit by the uworker? Why not an assertion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expect the codepath to be hit by both uworker and tworker (is that what you mean).
I just don't want to do the cleanup in a twoker. It's pretty slow and it's doing things a tworker doesn't need like killing processes and removing tmpdirs. tworker doesn't really need this because it's not actually running or downloading anything.
@@ -468,7 +470,6 @@ def process_command_impl(task_name, task_argument, job_name, high_end, | |||
return run_command(task_name, task_argument, job_name, uworker_env) | |||
finally: | |||
# Final clean up. | |||
if not environment.is_tworker(): | |||
cleanup_task_state() | |||
cleanup_task_state() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this got removed from L83, since you make sure that this code is not reached by the uworker? Is there anything other than the uworker that you want to avoid reaching this code path? Or is there any other mechanism in place that would avoid the old untrusted worker architecture to get here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry do you mean a different PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line of code, sorry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the question kind of confusing, but I'm no longer relying on that old if statement, the new one is better because the function is called from more than one place.
This doesn't really have anything to do with the untrusted arch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, with some clarifications