veyron,veyron2: rename runtime.Shutdown to runtime.Cleanup.
Context:
https://docs.google.com/a/google.com/document/d/1Sfq1ZEEPtxMFR2Wj6SFNMlNNXZ9xnuz-Cep73RXmBwI/edit
Change-Id: I20b89e7acf70f97c3216bc155e7afcce0cc5db0a
diff --git a/examples/rockpaperscissors/impl/impl_test.go b/examples/rockpaperscissors/impl/impl_test.go
index 9a2bc32..5a6a856 100644
--- a/examples/rockpaperscissors/impl/impl_test.go
+++ b/examples/rockpaperscissors/impl/impl_test.go
@@ -68,7 +68,7 @@
// that all the counters are consistent.
func TestRockPaperScissorsImpl(t *testing.T) {
runtime := rt.Init()
- defer runtime.Shutdown()
+ defer runtime.Cleanup()
mtAddress, mtStop := startMountTable(t, runtime)
defer mtStop()
rpsService, rpsStop := startRockPaperScissors(t, runtime, mtAddress)
diff --git a/examples/rockpaperscissors/rpsbot/main.go b/examples/rockpaperscissors/rpsbot/main.go
index 9e9a011..a29b8fc 100644
--- a/examples/rockpaperscissors/rpsbot/main.go
+++ b/examples/rockpaperscissors/rpsbot/main.go
@@ -29,7 +29,7 @@
func main() {
r := rt.Init()
- defer r.Shutdown()
+ defer r.Cleanup()
server, err := r.NewServer()
if err != nil {
vlog.Fatalf("NewServer failed: %v", err)
diff --git a/examples/rockpaperscissors/rpsplayercli/main.go b/examples/rockpaperscissors/rpsplayercli/main.go
index 7d0d0d9..074907e 100644
--- a/examples/rockpaperscissors/rpsplayercli/main.go
+++ b/examples/rockpaperscissors/rpsplayercli/main.go
@@ -31,7 +31,7 @@
func main() {
r := rt.Init()
- defer r.Shutdown()
+ defer r.Cleanup()
for {
if selectOne([]string{"Initiate Game", "Wait For Challenge"}) == 0 {
initiateGame()
diff --git a/examples/rockpaperscissors/rpsscorekeeper/main.go b/examples/rockpaperscissors/rpsscorekeeper/main.go
index aca0293..ff0aca9 100644
--- a/examples/rockpaperscissors/rpsscorekeeper/main.go
+++ b/examples/rockpaperscissors/rpsscorekeeper/main.go
@@ -35,7 +35,7 @@
func main() {
r := rt.Init()
- defer r.Shutdown()
+ defer r.Cleanup()
server, err := r.NewServer()
if err != nil {
vlog.Fatalf("NewServer failed: %v", err)
diff --git a/examples/runtime/complex_server.go b/examples/runtime/complex_server.go
index c8e5a01..66a0122 100644
--- a/examples/runtime/complex_server.go
+++ b/examples/runtime/complex_server.go
@@ -17,9 +17,9 @@
func complexServerProgram() {
// Initialize the runtime. This is boilerplate.
r := rt.Init()
- // r.Shutdown is optional, but it's a good idea to clean up, especially
+ // r.Cleanup is optional, but it's a good idea to clean up, especially
// since it takes care of flushing the logs before exiting.
- defer r.Shutdown()
+ defer r.Cleanup()
// Create a couple servers, and start serving.
server1 := makeServer()
diff --git a/examples/runtime/simple_server.go b/examples/runtime/simple_server.go
index 3fc9a85..b459d80 100644
--- a/examples/runtime/simple_server.go
+++ b/examples/runtime/simple_server.go
@@ -16,13 +16,13 @@
// Initialize the runtime. This is boilerplate.
r := rt.Init()
- // r.Shutdown is optional, but it's a good idea to clean up, especially
+ // r.Cleanup is optional, but it's a good idea to clean up, especially
// since it takes care of flushing the logs before exiting.
//
// We use defer to ensure this is the last thing in the program (to
// avoid shutting down the runtime while it may still be in use), and to
// allow it to execute even if a panic occurs down the road.
- defer r.Shutdown()
+ defer r.Cleanup()
// Create a server, and start serving.
server := makeServer()
diff --git a/examples/tunnel/tunneld/main.go b/examples/tunnel/tunneld/main.go
index 4520127..9d0a9e8 100644
--- a/examples/tunnel/tunneld/main.go
+++ b/examples/tunnel/tunneld/main.go
@@ -41,7 +41,7 @@
func main() {
r := rt.Init()
- defer r.Shutdown()
+ defer r.Cleanup()
server, err := r.NewServer()
if err != nil {
vlog.Fatalf("NewServer failed: %v", err)
diff --git a/examples/tunnel/vsh/main.go b/examples/tunnel/vsh/main.go
index 42165b4..7776d9e 100644
--- a/examples/tunnel/vsh/main.go
+++ b/examples/tunnel/vsh/main.go
@@ -71,7 +71,7 @@
func realMain() int {
r := rt.Init()
- defer r.Shutdown()
+ defer r.Cleanup()
host, cmd, err := veyronNameAndCommandLine()
if err != nil {
diff --git a/examples/unresolve/test_util.go b/examples/unresolve/test_util.go
index 7725c67..031258a 100644
--- a/examples/unresolve/test_util.go
+++ b/examples/unresolve/test_util.go
@@ -21,7 +21,7 @@
)
func initRT(opts ...veyron2.ROpt) func() {
- return rt.Init(opts...).Shutdown
+ return rt.Init(opts...).Cleanup
}
func createServer(name string, dispatcher ipc.Dispatcher, opts ...ipc.ServerOpt) (ipc.Server, string) {
diff --git a/examples/wspr_sample/sampled/main.go b/examples/wspr_sample/sampled/main.go
index fce02eb..0860680 100644
--- a/examples/wspr_sample/sampled/main.go
+++ b/examples/wspr_sample/sampled/main.go
@@ -12,7 +12,7 @@
func main() {
// Create the runtime
r := rt.Init()
- defer r.Shutdown()
+ defer r.Cleanup()
s, endpoint, err := lib.StartServer(r)
if err != nil {
diff --git a/lib/signals/signals_test.go b/lib/signals/signals_test.go
index bbd576c..93480f8 100644
--- a/lib/signals/signals_test.go
+++ b/lib/signals/signals_test.go
@@ -52,7 +52,7 @@
wait := ShutdownOnSignals(signals...)
fmt.Println("ready")
fmt.Println("received signal", <-wait)
- r.Shutdown()
+ r.Cleanup()
<-closeStopLoop
}
@@ -69,7 +69,7 @@
}
func handleDefaultsIgnoreChan([]string) {
- defer rt.Init().Shutdown()
+ defer rt.Init().Cleanup()
closeStopLoop := make(chan struct{})
go stopLoop(closeStopLoop)
ShutdownOnSignals()
@@ -302,7 +302,7 @@
// TestCleanRemoteShutdown verifies that remote shutdown works correctly.
func TestCleanRemoteShutdown(t *testing.T) {
r := rt.Init()
- defer r.Shutdown()
+ defer r.Cleanup()
c := blackbox.HelperCommand(t, "handleDefaults")
defer c.Cleanup()
// This sets up the child's identity to be derived from the parent's (so
diff --git a/lib/testutil/security/util_test.go b/lib/testutil/security/util_test.go
index 5632aef..3aac88d 100644
--- a/lib/testutil/security/util_test.go
+++ b/lib/testutil/security/util_test.go
@@ -17,7 +17,7 @@
if err != nil {
t.Fatalf("rt.New failed: %v", err)
}
- defer r.Shutdown()
+ defer r.Cleanup()
newID := func(name string) security.PrivateID {
id, err := r.NewIdentity(name)
if err != nil {
@@ -48,7 +48,7 @@
if err != nil {
t.Fatalf("rt.New failed: %v", err)
}
- defer r.Shutdown()
+ defer r.Cleanup()
acl := security.ACL{
"veyron/alice": security.LabelSet(security.ReadLabel | security.WriteLabel),
"veyron/bob": security.LabelSet(security.ReadLabel),
@@ -76,7 +76,7 @@
if err != nil {
t.Fatalf("rt.New failed: %v", err)
}
- defer r.Shutdown()
+ defer r.Cleanup()
id, err := r.NewIdentity("test")
if err != nil {
t.Fatalf("r.NewIdentity failed: %v", err)
diff --git a/runtimes/google/naming/namespace/all_test.go b/runtimes/google/naming/namespace/all_test.go
index 4db264c..3925350 100644
--- a/runtimes/google/naming/namespace/all_test.go
+++ b/runtimes/google/naming/namespace/all_test.go
@@ -391,7 +391,7 @@
sr := rt.Init()
r, _ := rt.New() // We use a different runtime for the client side.
- defer r.Shutdown()
+ defer r.Cleanup()
root, _, _, stopper := createNamespace(t, sr)
defer stopper()
@@ -455,7 +455,7 @@
t.Skip()
sr := rt.Init()
r, _ := rt.New() // We use a different runtime for the client side.
- defer r.Shutdown()
+ defer r.Cleanup()
root, mts, jokes, stopper := createNamespace(t, sr)
runNestedMountTables(t, sr, mts)
defer stopper()
@@ -472,7 +472,7 @@
t.Skip()
sr := rt.Init()
r, _ := rt.New() // We use a different runtime for the client side.
- defer r.Shutdown()
+ defer r.Cleanup()
_, _, _, stopper := createNamespace(t, sr)
defer func() {
vlog.Infof("%d goroutines:", runtime.NumGoroutine())
@@ -486,7 +486,7 @@
func TestBadRoots(t *testing.T) {
r, _ := rt.New()
- defer r.Shutdown()
+ defer r.Cleanup()
if _, err := namespace.New(r); err != nil {
t.Errorf("namespace.New should not have failed with no roots")
}
diff --git a/runtimes/google/rt/mgmt_test.go b/runtimes/google/rt/mgmt_test.go
index e3dfdf6..bb78645 100644
--- a/runtimes/google/rt/mgmt_test.go
+++ b/runtimes/google/rt/mgmt_test.go
@@ -164,7 +164,7 @@
checkNoProgress(t, ch)
m.AdvanceGoal(0)
checkNoProgress(t, ch)
- m.Shutdown()
+ m.Cleanup()
if _, ok := <-ch; ok {
t.Errorf("Expected channel to be closed")
}
@@ -197,7 +197,7 @@
m.AdvanceGoal(4)
checkProgress(t, ch1, 11, 4)
checkProgress(t, ch2, 11, 4)
- m.Shutdown()
+ m.Cleanup()
if _, ok := <-ch1; ok {
t.Errorf("Expected channel to be closed")
}
@@ -216,7 +216,7 @@
fmt.Printf("Error creating runtime: %v\n", err)
return
}
- defer r.Shutdown()
+ defer r.Cleanup()
ch := make(chan string, 1)
r.WaitForStop(ch)
fmt.Printf("Got %s\n", <-ch)
@@ -279,7 +279,7 @@
configServer.Stop()
c.Cleanup()
os.Remove(idFile)
- // Don't do r.Shutdown() since the runtime needs to be used by
+ // Don't do r.Cleanup() since the runtime needs to be used by
// more than one test case.
}
}
diff --git a/runtimes/google/rt/rt.go b/runtimes/google/rt/rt.go
index a27b496..72470fe 100644
--- a/runtimes/google/rt/rt.go
+++ b/runtimes/google/rt/rt.go
@@ -152,7 +152,7 @@
return nil
}
-func (rt *vrt) Shutdown() {
+func (rt *vrt) Cleanup() {
// TODO(caprita): Consider shutting down mgmt later in the runtime's
// shutdown sequence, to capture some of the runtime internal shutdown
// tasks in the task tracker.
diff --git a/runtimes/google/vsync/vsyncd/main.go b/runtimes/google/vsync/vsyncd/main.go
index 506c49d..c49de82 100644
--- a/runtimes/google/vsync/vsyncd/main.go
+++ b/runtimes/google/vsync/vsyncd/main.go
@@ -30,7 +30,7 @@
// Create the runtime.
r := rt.Init()
- defer r.Shutdown()
+ defer r.Cleanup()
// Create a new server instance.
s, err := r.NewServer()
diff --git a/services/gateway/gatewayd/main.go b/services/gateway/gatewayd/main.go
index 897b542..3025812 100644
--- a/services/gateway/gatewayd/main.go
+++ b/services/gateway/gatewayd/main.go
@@ -37,7 +37,7 @@
// Get the runtime.
r := rt.Init()
- defer r.Shutdown()
+ defer r.Cleanup()
// Create a new instance of the gateway service.
vlog.Info("Connecting to proximity service: ", *proximity)
diff --git a/services/identity/handlers/handlers_test.go b/services/identity/handlers/handlers_test.go
index e540eb8..4793c73 100644
--- a/services/identity/handlers/handlers_test.go
+++ b/services/identity/handlers/handlers_test.go
@@ -37,7 +37,7 @@
if err != nil {
t.Fatal(err)
}
- defer r.Shutdown()
+ defer r.Cleanup()
ts := httptest.NewServer(Random{r})
defer ts.Close()
@@ -55,7 +55,7 @@
if err != nil {
t.Fatal(err)
}
- defer r.Shutdown()
+ defer r.Cleanup()
ts := httptest.NewServer(http.HandlerFunc(Bless))
defer ts.Close()
diff --git a/services/identity/identityd/main.go b/services/identity/identityd/main.go
index ca2a145..b1832e8 100644
--- a/services/identity/identityd/main.go
+++ b/services/identity/identityd/main.go
@@ -33,7 +33,7 @@
// Setup flags and logging
flag.Usage = usage
r := rt.Init()
- defer r.Shutdown()
+ defer r.Cleanup()
if len(*generate) > 0 {
generateAndSaveIdentity()
diff --git a/services/mgmt/application/applicationd/main.go b/services/mgmt/application/applicationd/main.go
index d5e0a33..38e3177 100644
--- a/services/mgmt/application/applicationd/main.go
+++ b/services/mgmt/application/applicationd/main.go
@@ -23,7 +23,7 @@
vlog.Fatalf("Specify a store using --store=<name>")
}
runtime := rt.Init()
- defer runtime.Shutdown()
+ defer runtime.Cleanup()
server, err := runtime.NewServer()
if err != nil {
vlog.Fatalf("NewServer() failed: %v", err)
diff --git a/services/mgmt/application/impl/impl_test.go b/services/mgmt/application/impl/impl_test.go
index 76a0fd6..3321f58 100644
--- a/services/mgmt/application/impl/impl_test.go
+++ b/services/mgmt/application/impl/impl_test.go
@@ -17,7 +17,7 @@
func TestInterface(t *testing.T) {
runtime := rt.Init()
ctx := runtime.NewContext()
- defer runtime.Shutdown()
+ defer runtime.Cleanup()
// Setup and start the application repository server.
server, err := runtime.NewServer()
diff --git a/services/mgmt/binary/binaryd/main.go b/services/mgmt/binary/binaryd/main.go
index 55b4d6a..bb59019 100644
--- a/services/mgmt/binary/binaryd/main.go
+++ b/services/mgmt/binary/binaryd/main.go
@@ -61,7 +61,7 @@
}
vlog.Infof("Binary repository rooted at %v", root)
runtime := rt.Init()
- defer runtime.Shutdown()
+ defer runtime.Cleanup()
server, err := runtime.NewServer()
if err != nil {
vlog.Errorf("NewServer() failed: %v", err)
diff --git a/services/mgmt/node/impl/impl_test.go b/services/mgmt/node/impl/impl_test.go
index 1e62541..8a4cd47 100644
--- a/services/mgmt/node/impl/impl_test.go
+++ b/services/mgmt/node/impl/impl_test.go
@@ -219,7 +219,7 @@
}
case "parent":
runtime := rt.Init()
- defer runtime.Shutdown()
+ defer runtime.Cleanup()
// Set up a mock binary repository, a mock application repository, and a node manager.
_, crCleanup := startBinaryRepository()
defer crCleanup()
@@ -232,7 +232,7 @@
blackbox.WaitForEOFOnStdin()
case "child":
runtime := rt.Init()
- defer runtime.Shutdown()
+ defer runtime.Cleanup()
// Set up a node manager.
name, nmCleanup := startNodeManager()
defer nmCleanup()
diff --git a/services/mgmt/node/noded/main.go b/services/mgmt/node/noded/main.go
index af7c5d2..b993371 100644
--- a/services/mgmt/node/noded/main.go
+++ b/services/mgmt/node/noded/main.go
@@ -28,7 +28,7 @@
vlog.Fatalf("Specify the node manager origin as environment variable %s=<name>", impl.OriginEnv)
}
runtime := rt.Init()
- defer runtime.Shutdown()
+ defer runtime.Cleanup()
server, err := runtime.NewServer()
if err != nil {
vlog.Fatalf("NewServer() failed: %v", err)
diff --git a/services/mgmt/profile/impl/impl_test.go b/services/mgmt/profile/impl/impl_test.go
index 6822260..bb52ef9 100644
--- a/services/mgmt/profile/impl/impl_test.go
+++ b/services/mgmt/profile/impl/impl_test.go
@@ -26,7 +26,7 @@
// the Profile interface.
func TestInterface(t *testing.T) {
runtime := rt.Init()
- defer runtime.Shutdown()
+ defer runtime.Cleanup()
ctx := runtime.NewContext()
diff --git a/services/mgmt/profile/profiled/main.go b/services/mgmt/profile/profiled/main.go
index cc33f62..93c5b68 100644
--- a/services/mgmt/profile/profiled/main.go
+++ b/services/mgmt/profile/profiled/main.go
@@ -23,7 +23,7 @@
vlog.Fatalf("Specify a store using --store=<name>")
}
runtime := rt.Init()
- defer runtime.Shutdown()
+ defer runtime.Cleanup()
server, err := runtime.NewServer()
if err != nil {
vlog.Fatalf("NewServer() failed: %v", err)
diff --git a/services/mgmt/root/rootd/main.go b/services/mgmt/root/rootd/main.go
index ae4b33a..c20a76a 100644
--- a/services/mgmt/root/rootd/main.go
+++ b/services/mgmt/root/rootd/main.go
@@ -10,7 +10,7 @@
func main() {
r := rt.Init()
- defer r.Shutdown()
+ defer r.Cleanup()
server, err := r.NewServer()
if err != nil {
vlog.Errorf("NewServer() failed: %v", err)
diff --git a/services/mounttable/mounttabled/mounttable.go b/services/mounttable/mounttabled/mounttable.go
index 23cf394..658aab0 100644
--- a/services/mounttable/mounttabled/mounttable.go
+++ b/services/mounttable/mounttabled/mounttable.go
@@ -52,7 +52,7 @@
func main() {
flag.Usage = Usage
r := rt.Init()
- defer r.Shutdown()
+ defer r.Cleanup()
mtServer, err := r.NewServer(veyron2.ServesMountTableOpt(true))
if err != nil {
diff --git a/services/proximity/proximityd/main.go b/services/proximity/proximityd/main.go
index fdb3201..43cb723 100644
--- a/services/proximity/proximityd/main.go
+++ b/services/proximity/proximityd/main.go
@@ -30,7 +30,7 @@
func main() {
// Get the runtime.
r := rt.Init()
- defer r.Shutdown()
+ defer r.Cleanup()
// Create a new server.
s, err := r.NewServer()
diff --git a/services/proxy/proxyd/main.go b/services/proxy/proxyd/main.go
index 90fead3..f30b10f 100644
--- a/services/proxy/proxyd/main.go
+++ b/services/proxy/proxyd/main.go
@@ -26,7 +26,7 @@
)
r := rt.Init()
- defer r.Shutdown()
+ defer r.Cleanup()
rid, err := naming.NewRoutingID()
if err != nil {
diff --git a/services/wspr/wsprd/lib/wspr.go b/services/wspr/wsprd/lib/wspr.go
index 4251ed9..17e6f5b 100644
--- a/services/wspr/wsprd/lib/wspr.go
+++ b/services/wspr/wsprd/lib/wspr.go
@@ -873,7 +873,7 @@
}
func (ctx WSPR) Shutdown() {
- ctx.rt.Shutdown()
+ ctx.rt.Cleanup()
}
// Creates a new WebSocket Proxy object.
diff --git a/tools/application/main.go b/tools/application/main.go
index 2ac2ee8..a510dcc 100644
--- a/tools/application/main.go
+++ b/tools/application/main.go
@@ -7,6 +7,6 @@
)
func main() {
- defer rt.Init().Shutdown()
+ defer rt.Init().Cleanup()
impl.Root().Main()
}
diff --git a/tools/binary/main.go b/tools/binary/main.go
index de795aa..e03d21c 100644
--- a/tools/binary/main.go
+++ b/tools/binary/main.go
@@ -8,7 +8,7 @@
func main() {
r := rt.Init()
- defer r.Shutdown()
+ defer r.Cleanup()
impl.Root().Main()
}
diff --git a/tools/mounttable/main.go b/tools/mounttable/main.go
index a59a17b..61a93d6 100644
--- a/tools/mounttable/main.go
+++ b/tools/mounttable/main.go
@@ -7,6 +7,6 @@
)
func main() {
- defer rt.Init().Shutdown()
+ defer rt.Init().Cleanup()
impl.Root().Main()
}
diff --git a/tools/namespace/main.go b/tools/namespace/main.go
index 4a0ff2d..64f046e 100644
--- a/tools/namespace/main.go
+++ b/tools/namespace/main.go
@@ -7,6 +7,6 @@
)
func main() {
- defer rt.Init().Shutdown()
+ defer rt.Init().Cleanup()
impl.Root().Main()
}
diff --git a/tools/profile/main.go b/tools/profile/main.go
index 71a015a..da5821b 100644
--- a/tools/profile/main.go
+++ b/tools/profile/main.go
@@ -8,7 +8,7 @@
func main() {
r := rt.Init()
- defer r.Shutdown()
+ defer r.Cleanup()
impl.Root().Main()
}
diff --git a/tools/proximity/main.go b/tools/proximity/main.go
index 07ab805..a5d8826 100644
--- a/tools/proximity/main.go
+++ b/tools/proximity/main.go
@@ -7,6 +7,6 @@
)
func main() {
- defer rt.Init().Shutdown()
+ defer rt.Init().Cleanup()
impl.Root().Main()
}
diff --git a/tools/vrpc/impl/impl_test.go b/tools/vrpc/impl/impl_test.go
index 262f3e8..941662b 100644
--- a/tools/vrpc/impl/impl_test.go
+++ b/tools/vrpc/impl/impl_test.go
@@ -170,7 +170,7 @@
func TestVRPC(t *testing.T) {
runtime := rt.Init()
- // Skip defer runtime.Shutdown() to avoid messing up other tests in the
+ // Skip defer runtime.Cleanup() to avoid messing up other tests in the
// same process.
server, endpoint, err := startServer(t, runtime)
if err != nil {
diff --git a/tools/vrpc/main.go b/tools/vrpc/main.go
index 6711130..1cf6021 100644
--- a/tools/vrpc/main.go
+++ b/tools/vrpc/main.go
@@ -8,6 +8,6 @@
func main() {
r := rt.Init()
- defer r.Shutdown()
+ defer r.Cleanup()
impl.Root().Main()
}