Skip to content

Commit

Permalink
[fs-irods_18] during data object auto close, take care of iRODSFS han…
Browse files Browse the repository at this point in the history
…dles first.
  • Loading branch information
d-w-moore committed Aug 23, 2024
1 parent dc6ea99 commit a9644b4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion irods/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,15 @@
_sessions = None
_sessions_lock = threading.Lock()


def _cleanup_remaining_sessions():
try:
import fs_irods.iRODSFS, sys
lfs = list(sys.modules[fs_irods.iRODSFS.__module__].fses)
for fs in lfs:
fs._finalize_files()
except Exception as e:
logging.getLogger(__name__).debug('%r attempting to close iRODSFS file descriptors',e)

for fd in list(_fds.keys()):
if not fd.closed:
fd.close()
Expand Down

0 comments on commit a9644b4

Please sign in to comment.