зеркало из https://github.com/github/vitess-gh.git
improved error handling, reload catches panics, fix test
This commit is contained in:
Родитель
6ccd4e2a6d
Коммит
ac403f00aa
|
@ -116,6 +116,8 @@ func (si *SchemaInfo) Close() {
|
|||
}
|
||||
|
||||
func (si *SchemaInfo) Reload() {
|
||||
var err error
|
||||
defer handleError(&err, nil)
|
||||
conn := si.connPool.Get()
|
||||
defer conn.Recycle()
|
||||
tables, err := conn.ExecuteFetch([]byte(fmt.Sprintf("%s and unix_timestamp(create_time) > %v", base_show_tables, si.lastChange.Unix())), maxTableCount, false)
|
||||
|
|
|
@ -73,7 +73,13 @@ func handleError(err *error, logStats *sqlQueryStats) {
|
|||
logStats.Send()
|
||||
}
|
||||
if x := recover(); x != nil {
|
||||
terr := x.(*TabletError)
|
||||
terr, ok := x.(*TabletError)
|
||||
if !ok {
|
||||
relog.Error("Uncaught panic:\n%v\n%s", x, relog.Stack(4))
|
||||
*err = NewTabletError(FAIL, "%v: uncaught panic", x)
|
||||
errorStats.Add("Panic", 1)
|
||||
return
|
||||
}
|
||||
*err = terr
|
||||
terr.RecordStats()
|
||||
if terr.ErrorType == RETRY { // Retry errors are too spammy
|
||||
|
|
|
@ -276,7 +276,7 @@ class VtoccTestEnv(TestEnv):
|
|||
subprocess.call([
|
||||
self.vtroot+"/bin/mysqlctl",
|
||||
"-tablet-uid", self.tabletuid,
|
||||
"-force", "teardown"
|
||||
"teardown", "-force"
|
||||
])
|
||||
shutil.rmtree(self.mysqldir)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче