Add more logging for execution requests
This commit is contained in:
@ -53,6 +53,7 @@ class Runner < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def attach_to_execution(command, &block)
|
def attach_to_execution(command, &block)
|
||||||
|
Rails.logger.debug { "#{Time.zone.now.getutc.inspect}: Starting execution with Runner #{id} for #{user_type} #{user_id}." }
|
||||||
starting_time = Time.zone.now
|
starting_time = Time.zone.now
|
||||||
begin
|
begin
|
||||||
# As the EventMachine reactor is probably shared with other threads, we cannot use EventMachine.run with
|
# As the EventMachine reactor is probably shared with other threads, we cannot use EventMachine.run with
|
||||||
@ -68,6 +69,7 @@ class Runner < ApplicationRecord
|
|||||||
e.execution_duration = Time.zone.now - starting_time
|
e.execution_duration = Time.zone.now - starting_time
|
||||||
raise
|
raise
|
||||||
end
|
end
|
||||||
|
Rails.logger.debug { "#{Time.zone.now.getutc.inspect}: Stopped execution with Runner #{id} for #{user_type} #{user_id}." }
|
||||||
Time.zone.now - starting_time # execution duration
|
Time.zone.now - starting_time # execution duration
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -199,6 +199,7 @@ class Submission < ApplicationRecord
|
|||||||
runner = Runner.for(user, exercise.execution_environment)
|
runner = Runner.for(user, exercise.execution_environment)
|
||||||
files = collect_files
|
files = collect_files
|
||||||
files.reject!(&:teacher_defined_assessment?) if cause == 'run'
|
files.reject!(&:teacher_defined_assessment?) if cause == 'run'
|
||||||
|
Rails.logger.debug { "#{Time.zone.now.getutc.inspect}: Copying files to Runner #{runner.id} for #{user_type} #{user_id} and Submission #{id}." }
|
||||||
runner.copy_files(files)
|
runner.copy_files(files)
|
||||||
rescue Runner::Error => e
|
rescue Runner::Error => e
|
||||||
e.waiting_duration = Time.zone.now - request_time
|
e.waiting_duration = Time.zone.now - request_time
|
||||||
|
Reference in New Issue
Block a user