Replies: 3 comments
-
Calling .close() should be the right thing to do. However, you need to call .close() on the actual repository handle that is still active. What kind of code is triggering the exception? Is it working with the repository? |
Beta Was this translation helpful? Give feedback.
-
The most recent issue i've been running into was with porcelain.push() correctly failing. All the exception handling is done in a different area of the code though, so I don't have access to the original handle. Is there any downside that you know of to just closing the repo immediately after creating it like I have above? |
Beta Was this translation helpful? Give feedback.
-
Actions that touch the repo afterwards can leave open handles that need to be closed. Calling close() after the repo is opened is not sufficient; you need to call close after the last operation that touched the repo. For example, after you've accessed some objects, Dulwich will have open handles to the packs that those objects are stored in. This is done intentionally for performance reasons. |
Beta Was this translation helpful? Give feedback.
-
I have the following scenario:
I've tried adding this to the exception handling before deleting the repo:
which works sometimes, but not in all scenarios.
I've found that if I always just close the repo immediately after init/clone, and then just reopen it, I never run into any issues when trying to delete the repo later:
This should mean that one of the two is true:
@jelmer Do you know which of these two is the case?
Beta Was this translation helpful? Give feedback.
All reactions