Skip to content

Commit 17b95ed

Browse files
committed
Gracefully handle tubesock handshake failures for run
1 parent d14ef44 commit 17b95ed

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/controllers/submissions_controller.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ def run # rubocop:disable Metrics/PerceivedComplexity, Metrics/CyclomaticComplex
168168

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

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

0 commit comments

Comments
 (0)