Files
ubicloud/model/load_balancer_vm_port.rb
Daniel Farina 9772ffd8d0 Add support for stale connection retry on connection reset by peer
My change for aa2e0c0749, with the fix
in 8df8d6c7ac, appears effective, but
only handles system call failures on write: sometimes the program only
receives notification of the connection being closed upon a read, like
this:

    /app/vendor/bundle/ruby/3.4.0/gems/net-ssh-7.3.0/lib/net/ssh/buffered_io.rb:64:in 'BasicSocket#recv'
    /app/vendor/bundle/ruby/3.4.0/gems/net-ssh-7.3.0/lib/net/ssh/buffered_io.rb:64:in 'Net::SSH::BufferedIo#fill'
    /app/vendor/bundle/ruby/3.4.0/gems/net-ssh-7.3.0/lib/net/ssh/connection/session.rb:275:in 'block in Net::SSH::Connection::Session#ev_do_handle_events'

The exception is an instance of `Errno::ECONNRESET` with a message
like `Connection reset by peer - recvfrom(2)`.

So, handle it much the same way, and refactor the tests to test with
either exception.
2025-07-31 13:04:39 -07:00

4.2 KiB