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 @@
case event[:cmd]
when :client_kill
@testrun[:status] = :terminated_by_client
runner_socket&.close(:terminated_by_client)

Check warning on line 143 in app/controllers/submissions_controller.rb

View check run for this annotation

Codecov / codecov/patch

app/controllers/submissions_controller.rb#L143

Added line #L143 was not covered by tests
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 @@
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

Check warning on line 91 in lib/runner/connection.rb

View check run for this annotation

Codecov / codecov/patch

lib/runner/connection.rb#L90-L91

Added lines #L90 - L91 were not covered by tests
end
end

# Check if the WebSocket connection is currently established
Expand Down