Check that a mirror write returning an error will cause a reconnect and retry
This commit is contained in:
@@ -6,22 +6,23 @@
|
||||
# write has gone MIA, and we expect a reconnect.
|
||||
|
||||
require 'flexnbd/fake_dest'
|
||||
include FlexNBD::FakeDest
|
||||
include FlexNBD
|
||||
|
||||
sock = serve( *ARGV )
|
||||
client_sock1 = accept( sock )
|
||||
write_hello( client_sock1 )
|
||||
read_request( client_sock1 )
|
||||
server = FakeDest.new( *ARGV )
|
||||
client1 = server.accept( server )
|
||||
client1.write_hello
|
||||
client1.read_request
|
||||
|
||||
t = Thread.start do
|
||||
client_sock2 = accept( sock, "Timed out waiting for a reconnection",
|
||||
client2 = server.accept( "Timed out waiting for a reconnection",
|
||||
FlexNBD::MS_REQUEST_LIMIT_SECS + 2 )
|
||||
client_sock2.close
|
||||
client2.close
|
||||
end
|
||||
|
||||
sleep( FlexNBD::MS_REQUEST_LIMIT_SECS + 2 )
|
||||
client_sock1.close
|
||||
client1.close
|
||||
|
||||
t.join
|
||||
|
||||
server.close
|
||||
exit(0)
|
||||
|
Reference in New Issue
Block a user