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

Release runner in case of errors #2520

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/models/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def copy_files(files)
def download_file(desired_file, privileged_execution:, exclusive: true, &)
reserve! if exclusive
@strategy.download_file(desired_file, privileged_execution:, &)
ensure
release! if exclusive
end

Expand Down Expand Up @@ -107,9 +108,10 @@ def attach_to_execution(command, privileged_execution: false, exclusive: true, &
e.execution_duration = Time.zone.now - starting_time
raise
end
release! if exclusive
Rails.logger.debug { "#{Time.zone.now.getutc.inspect}: Stopped execution with Runner #{id} for #{contributor_type} #{contributor_id}." }
Time.zone.now - starting_time # execution duration
ensure
release! if exclusive
end

def execute_command(command, privileged_execution: false, raise_exception: true, exclusive: true)
Expand Down