Skip to content

Commit

Permalink
Merge pull request FederatedAI#4152 from FederatedAI/feature-1.9.0-fa…
Browse files Browse the repository at this point in the history
…te_flow-anonymous

Feature 1.9.0 fate flow anonymous
  • Loading branch information
zhihuiwan authored Jul 28, 2022
2 parents 9c3a6c6 + fd182e8 commit 9a7fd98
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions python/fate_arch/session/_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ def __exit__(self, exc_type, exc_val, exc_tb):
self._logger.exception("", exc_info=(exc_type, exc_val, exc_tb))
return self._close()

def __del__(self):
self.destroy_all_sessions()

def init_computing(self,
computing_session_id: str = None,
record: bool = True,
Expand Down Expand Up @@ -506,21 +503,24 @@ def wait_remote_all_done(self, timeout=None):
def cleanup(self):
# clean up session temporary tables
if self._storage_engine in [StorageEngine.STANDALONE, StorageEngine.EGGROLL]:
storage = self.storage()
if self.is_computing_valid:
try:
self._logger.info('clean table by namespace {}'.format(self._computing_session.session_id))
storage.cleanup(namespace=self._computing_session.session_id, name="*")
self._logger.info(f'clean table namespace {self._computing_session.session_id} done')
except Exception as e:
self._logger.warning(f"no found table namespace {self._computing_session.session_id}")
if self.is_federation_valid:
try:
self._logger.info('clean table by namespace {}'.format(self._federation_session.session_id))
storage.cleanup(namespace=self._federation_session.session_id, name="*")
self._logger.info(f'clean table namespace {self._federation_session.session_id} done')
except Exception as e:
self._logger.warning(f"no found table namespace {self._federation_session.session_id}")
if self.is_computing_valid or self.is_federation_valid:
storage = self.storage()
if self.is_computing_valid:
try:
self._logger.info('clean table by namespace {}'.format(self._computing_session.session_id))
storage.cleanup(namespace=self._computing_session.session_id, name="*")
self._logger.info(f'clean table namespace {self._computing_session.session_id} done')
except Exception as e:
self._logger.warning(f"no found table namespace {self._computing_session.session_id}")
if self.is_federation_valid:
try:
self._logger.info('clean table by namespace {}'.format(self._federation_session.session_id))
storage.cleanup(namespace=self._federation_session.session_id, name="*")
self._logger.info(f'clean table namespace {self._federation_session.session_id} done')
except Exception as e:
self._logger.warning(f"no found table namespace {self._federation_session.session_id}")
storage.destroy()
self.delete_session_record(engine_session_id=storage.session_id)


def get_session() -> Session:
Expand Down

0 comments on commit 9a7fd98

Please sign in to comment.