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

Reserve runners for the whole duration of their use #2594

Merged
merged 1 commit into from
Oct 15, 2024
Merged

Conversation

MrSerth
Copy link
Member

@MrSerth MrSerth commented Oct 13, 2024

This commit changes how runners are reserved and released. Previously, a runner was reserved only for the actual time it was actively used and the aim was to reserve it for a time as short as possible. The previous mechanism worked, but had some drawbacks:

For example, a learner could start a submission scoring, which would perform (1) a file copy, (2) an execution of the first test file, (3) an execution of the second test file, etc. For each of these actions, the runner would be reserved and released. Now, it could happen that another run was triggered between the execution of both test files, causing issues with the remaining scoring.

In the refactored version, a runner is reserved once before initially copying files and only released after the last command finished. This ensures that no one can interrupt an execution started once, hopefully making it more robust (and faster, since less locks are required).

@MrSerth MrSerth added enhancement ruby Pull requests that update Ruby code labels Oct 13, 2024
@MrSerth MrSerth requested a review from Dome-GER October 13, 2024 20:53
@MrSerth MrSerth self-assigned this Oct 13, 2024
app/models/runner.rb Outdated Show resolved Hide resolved
This commit changes how runners are reserved and released. Previously, a runner was reserved only for the actual time it was actively used and the aim was to reserve it for a time as short as possible. The previous mechanism worked, but had some drawbacks:

For example, a learner could start a submission scoring, which would perform (1) a file copy, (2) an execution of the first test file, (3) an execution of the second test file, etc. For each of these actions, the runner would be reserved and released. Now, it could happen that another run was triggered between the execution of both test files, causing issues with the remaining scoring.

In the refactored version, a runner is reserved once before initially copying files and only released after the last command finished. This ensures that no one can interrupt an execution started once, hopefully making it more robust (and faster, since less locks are required).
Copy link

codecov bot commented Oct 15, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 9 lines in your changes missing coverage. Please review.

Project coverage is 69.60%. Comparing base (f289500) to head (05ab2d7).
Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
app/models/submission.rb 50.00% 7 Missing ⚠️
app/models/runner.rb 84.61% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2594      +/-   ##
==========================================
+ Coverage   69.56%   69.60%   +0.04%     
==========================================
  Files         202      202              
  Lines        6370     6376       +6     
==========================================
+ Hits         4431     4438       +7     
+ Misses       1939     1938       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Dome-GER Dome-GER merged commit c1b9cf9 into master Oct 15, 2024
9 of 10 checks passed
@Dome-GER Dome-GER deleted the runner_in_use branch October 15, 2024 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants