We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 082c4e3 commit 0db2282Copy full SHA for 0db2282
src/datachain/query/session.py
@@ -195,5 +195,11 @@ def _global_cleanup():
195
Session.GLOBAL_SESSION_CTX.__exit__(None, None, None)
196
197
for obj in gc.get_objects(): # Get all tracked objects
198
- if isinstance(obj, Session): # Cleanup temp dataset for session variables.
199
- obj.__exit__(None, None, None)
+ try:
+ if isinstance(obj, Session):
200
+ # Cleanup temp dataset for session variables.
201
+ obj.__exit__(None, None, None)
202
+ except ReferenceError:
203
+ continue # Object has been finalized already
204
+ except Exception as e: # noqa: BLE001
205
+ logger.error(f"Exception while cleaning up session: {e}") # noqa: G004
0 commit comments