-
Notifications
You must be signed in to change notification settings - Fork 41
Allow depending on tasks from an earlier submit in the jobfile #1031
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
base: main
Are you sure you want to change the base?
Conversation
61e1188 to
efb657c
Compare
Yes, Tako checks this, so in the case race condition. the second submit gets an error. I will do a proper code review tomorrow. |
| while idx < new_tasks.len() { | ||
| if let Some(consumers) = consumers.get(&new_tasks[idx].id) { | ||
|
|
||
| let mut handle_consumers = |
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 think that there is no need to construct "deps_from_previous_submit", you just need to check that tasks already exists (ID exits) and then forget it. You just need to modify the check for emptiness of deps. When all deps depends only on previously existing tasks, then you can put it immediately into new_tasks. Then there is no need to process anything like "deps_from_previous_submit" with handle_consumers.
(This is written from a hospital bed, so I may be wrong:)
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.
Good point, it's a nice simplification. It needed a few more changes, but it's better this way, I think.
efb657c to
940e9ed
Compare
| } | ||
|
|
||
| let task_deps_from_this_submit: Vec<JobTaskId> = t | ||
| .task_deps |
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.
Note: this could be
.iter()
.filter(|&task| !existing_tasks.contains(task))
.copied()
.collect();But I think that pre-cloning might be better to avoid partial reallocations of the Vec, since the usual case is that all/most deps will be from the same submit.
|
Maybe we can avoid creating |
We should be checking the validity of the tasks on the server too, as doing it on the client can cause race conditions, in theory. But even if that happens, the server will reject the submit anyway, I suppose.