Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions app/controllers/submissions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def run # rubocop:disable Metrics/PerceivedComplexity, Metrics/CyclomaticComplex
case event[:cmd]
when :client_kill
@testrun[:status] = :terminated_by_client
runner_socket&.close(:terminated_by_client)
close_client_connection(client_socket)
Rails.logger.debug('Client exited container.')
when :result, :canvasevent, :exception
Expand Down
7 changes: 6 additions & 1 deletion lib/runner/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ def close(status)
return unless active?

@status = status
@socket.close
# Close the WebSocket connection _immediately_
# by scheduling it for the next execution of the EventMachine reactor run.
# Otherwise, the message might be queued causing delays for users.
EventMachine.next_tick do
@socket.close
end
end

# Check if the WebSocket connection is currently established
Expand Down