fix issue that connection lost when training db restarted