Skip to content

Commit d4864ed

Browse files
committed
Don't finish already closed calls.
1 parent 46c027c commit d4864ed

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/async/container/supervisor/connection.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,11 @@ def each(&block)
5656
end
5757

5858
def finish(**response)
59-
self.push(id: @id, finished: true, **response)
60-
@queue.close
59+
# If the remote end has already closed the connection, we don't need to send a finished message:
60+
unless @queue.closed?
61+
self.push(id: @id, finished: true, **response)
62+
@queue.close
63+
end
6164
end
6265

6366
def fail(**response)

0 commit comments

Comments
 (0)