Don't open the control socket until after the server socket is bound

This makes it easier for the tests (and supervisor) to guarantee to be
able to connect to the server socket.

Also this patch moves freeing the mirror supervisor into the server
thread.
This commit is contained in:
Alex Young
2012-10-09 17:35:20 +01:00
parent 83eb31aba4
commit 22bea81445
12 changed files with 108 additions and 69 deletions

View File

@@ -97,7 +97,9 @@ class ValgrindKillingExecutor
when "line"
@error.add_line( @text ) if @found
when "error", "stack"
@killer.call( @error )
if @found
@killer.call( @error )
end
when "pid"
@error.pid=@text
end
@@ -326,8 +328,10 @@ module FlexNBD
def serve( file, *acl)
cmd = serve_cmd( file, acl )
run_serve_cmd( cmd )
sleep( 0.2 ) until File.exists?( ctrl )
end
def listen(file, *acl)
run_serve_cmd( listen_cmd( file, acl ) )
end