irods / python-irodsclient

A Python API for iRODS
Other
63 stars 73 forks source link

[#562] release old connection when redirecting #563

Closed d-w-moore closed 2 months ago

trel commented 3 months ago

does this explain it? even though the minimal example was encapsulated with a 'with' block?

d-w-moore commented 3 months ago

does this explain it? even though the minimal example was encapsulated with a 'with' block?

Yes, I believe it does. If we're redirecting to "another host's" resource (in this case, cleverly renamed localhost), the stored session within the FileRaw object (f) is a cloned session with connections to the newly-targeted host. Which explains why the wrap-up of the with-block (ie the data object close operation) \didn't matter; the resource leak happened in the process of redirecting (during the data-object open operation) when I failed to release a still-running connection before grabbing a new one and stashing it into the same variable (conn)

trel commented 3 months ago

Excellent. Wrap it in a test and away we go. Consider putting some/all of your explanation in the commit message body as well.

d-w-moore commented 2 months ago

Everything looks good to me, but there appears to be a conflict with one of the files. Please rebase and confirm things are working as expected, and I think we'll be good to go

Done.

d-w-moore commented 2 months ago

Very good. # it

Done!