Prevent duplicated WebSocket close for client_kill
Our investigation in CODEOCEAN-TV showed that we might attempt to close the WebSocket connection twice, if learners press the stop button. With this commit, we fix that issue.
This commit is contained in:
@ -242,7 +242,7 @@ class SubmissionsController < ApplicationController
|
||||
Sentry.capture_exception(e)
|
||||
extract_durations(e)
|
||||
ensure
|
||||
close_client_connection(client_socket)
|
||||
close_client_connection(client_socket) unless client_kill
|
||||
save_testrun_output 'run'
|
||||
Sentry.capture_message('Execution got terminated by client', extra: {websocket: @tubesock_debug_events, submission: @submission.id}) if @testrun[:status] == :terminated_by_client && !client_kill
|
||||
end
|
||||
|
Reference in New Issue
Block a user