Quit with an error status on SIGTERM during migration
This prevents the supervisor from thinking that the migration completed successfully. In order to do this, I've introduced a new lock around the start (and finish) of the migration so that we avoid a race between the signal handler in the server_accept loop and the control thread mirror startup. Without that, we'd risk successfully starting a migration after the SIGTERM handler fired, which would be Bad.
This commit is contained in:
@@ -121,11 +121,12 @@ class Environment
|
||||
|
||||
def run_fake( name, addr, port, sock=nil )
|
||||
fakedir = File.join( File.dirname( __FILE__ ), "fakes" )
|
||||
fake = Dir[File.join( fakedir, name ) + "*"].sort.find { |fn|
|
||||
fakeglob = File.join( fakedir, name ) + "*"
|
||||
fake = Dir[fakeglob].sort.find { |fn|
|
||||
File.executable?( fn )
|
||||
}
|
||||
|
||||
raise "no fake executable" unless fake
|
||||
raise "no fake executable at #{fakeglob}" unless fake
|
||||
raise "no addr" unless addr
|
||||
raise "no port" unless port
|
||||
|
||||
|
Reference in New Issue
Block a user