Skip to content

Commit

Permalink
Gracefully handle tubesock handshake failures for run
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSerth committed Nov 12, 2024
1 parent d14ef44 commit 17b95ed
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/controllers/submissions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ def run # rubocop:disable Metrics/PerceivedComplexity, Metrics/CyclomaticComplex

# If running is not allowed (and the socket is closed), we can stop here.
return true if @embed_options[:disable_run]
# If the tubesock handshake failed (and we didn't got a socket), we can stop here.
# With our custom tubesock patch, this will render a 426 status code already.
return true if client_socket.nil?

@testrun[:output] = +''
durations = @submission.run(@file) do |socket, starting_time|
Expand Down

0 comments on commit 17b95ed

Please sign in to comment.