Set _engine to None in finally
@@ -592,6 +592,7 @@ class Scheduler(object):
self._engine.close()
except Exception:
self._logger.exception('Unable to close the database connection pool')
+ finally:
self._engine = None
return True
