disco open/close debugging

This commit is contained in:
Travis 2021-01-14 23:02:58 -06:00
parent 4afaaa5e25
commit 684b20edb3
No known key found for this signature in database
GPG key ID: 37080CC2042BA34E
2 changed files with 5 additions and 0 deletions

View file

@ -611,6 +611,7 @@ func (s *Server) Open() error {
if err != nil {
return errors.Wrap(err, "starting DisCo")
}
fmt.Println("--- disco: open:", s.disCo.ID())
_ = initState
// Set node ID.
@ -679,6 +680,7 @@ func (s *Server) Open() error {
// Close closes the server and waits for it to shutdown.
func (s *Server) Close() error {
fmt.Println("--- disco: server close:", s.disCo.ID())
errE := s.executor.Close()
// Notify goroutines to stop.
@ -693,7 +695,9 @@ func (s *Server) Close() error {
}
errhs = s.syncer.stopTranslationSync()
if s.disCo != nil {
fmt.Println("--- disco: try close:", s.disCo.ID())
errd = s.disCo.Close()
fmt.Println("--- disco: closed", s.disCo.ID(), errd)
}
if s.holder != nil {
errh = s.holder.Close()

View file

@ -87,6 +87,7 @@ func TempDir(tb testing.TB, pattern string) (path string, err error) {
if err == nil {
Cleanup(tb, func() {
os.RemoveAll(path)
fmt.Println("--- testhook:", path, tb.Name())
})
}
return path, err