Close the control socket during cleanup
This should prevent further requests coming in, triggering deadlocks.
This commit is contained in:
@@ -827,6 +827,11 @@ void serve_cleanup(struct server *params,
|
|||||||
close(params->server_fd);
|
close(params->server_fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* close the control socket too */
|
||||||
|
if (params->flexnbd && params->flexnbd->control) {
|
||||||
|
control_signal_close(params->flexnbd->control);
|
||||||
|
}
|
||||||
|
|
||||||
/* need to stop background build if we're killed very early on */
|
/* need to stop background build if we're killed very early on */
|
||||||
pthread_cancel(params->allocation_map_builder_thread);
|
pthread_cancel(params->allocation_map_builder_thread);
|
||||||
pthread_join(params->allocation_map_builder_thread, &status);
|
pthread_join(params->allocation_map_builder_thread, &status);
|
||||||
@@ -861,15 +866,6 @@ void serve_cleanup(struct server *params,
|
|||||||
server_unlock_acl(params);
|
server_unlock_acl(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if( params->flexnbd ) { */
|
|
||||||
/* if ( params->flexnbd->control ) { */
|
|
||||||
/* flexnbd_stop_control( params->flexnbd ); */
|
|
||||||
/* } */
|
|
||||||
/* flexnbd_destroy( params->flexnbd ); */
|
|
||||||
/* } */
|
|
||||||
|
|
||||||
/* server_destroy( params ); */
|
|
||||||
|
|
||||||
debug("Cleanup done");
|
debug("Cleanup done");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -114,7 +114,7 @@ class TestWriteDuringMigration < Test::Unit::TestCase
|
|||||||
sock.flush
|
sock.flush
|
||||||
sock.readline
|
sock.readline
|
||||||
end
|
end
|
||||||
rescue Errno::ENOENT
|
rescue StandardError
|
||||||
# If the socket disappears, that's OK.
|
# If the socket disappears, that's OK.
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user