Fix error handling during Runner::Connection close

Closes CODEOCEAN-HQ
This commit is contained in:
Sebastian Serth
2023-02-16 10:47:28 +01:00
parent 596a04b9da
commit 91c2e14fe8
2 changed files with 7 additions and 1 deletions

View File

@ -220,6 +220,7 @@ class SubmissionsController < ApplicationController
@testrun[:output] = "timeout: #{@testrun[:output]}"
extract_durations(e)
rescue Runner::Error => e
# Regardless of the specific error cause, we send a `container_depleted` status to the client.
send_and_store client_socket, {cmd: :status, status: :container_depleted}
close_client_connection(client_socket)
@testrun[:status] ||= :container_depleted