You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "kwin (via GitHub)" <gi...@apache.org> on 2025/07/29 13:41:55 UTC

[I] GitPackCommand opens Repository without closing it [mina-sshd]

kwin opened a new issue, #793:
URL: https://github.com/apache/mina-sshd/issues/793

   ### Version
   
   2.15.1-SNAPSHOT
   
   ### Bug description
   
   The GitPackCommand opens a repository in https://github.com/apache/mina-sshd/blob/67e2e4c7482eabfa73303f728ec1d702f81847cf/sshd-git/src/main/java/org/apache/sshd/git/pack/GitPackCommand.java#L85 but never closes it accordingly, which leads to dangling file handles and problems when deleting the repository directory on Windows.
   
   ### Actual behavior
   
   Once you stop the SSH server and try to delete the underlying FS directory you observe the following on Windows:
   
   ```
   java.io.IOException: File D:\a\maven-scm\maven-scm\maven-scm-providers\maven-scm-providers-git\maven-scm-provider-gitexe\target\scm-test\repository\objects\pack\pack-eef7d0ee953db4f2dd2cdc2c2fb2bcd53123a248.pack unable to be deleted.
   ```
   (e.g. in https://github.com/apache/maven-scm/actions/runs/16597578214/job/46948644603?pr=1270)
   
   ### Expected behavior
   
   Every repository which is opened should also be closed afterwards.
   
   ### Relevant log output
   
   ```Shell
   
   ```
   
   ### Other information
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [I] GitPackCommand opens Repository without closing it [mina-sshd]

Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf commented on issue #793:
URL: https://github.com/apache/mina-sshd/issues/793#issuecomment-3132831424

   I'm not disputing that at all, just pointing out another potential problem with deleting git repositories.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [I] GitPackCommand opens Repository without closing it [mina-sshd]

Posted by "kwin (via GitHub)" <gi...@apache.org>.
kwin commented on issue #793:
URL: https://github.com/apache/mina-sshd/issues/793#issuecomment-3132744323

   I used `java.io.File` API which till recently also worked on read-only files (https://bugs.openjdk.org/browse/JDK-8355954). Still I faced the issue, so I think this is really about cached files being kept open by the underlying repository.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [I] GitPackCommand opens Repository without closing it [mina-sshd]

Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf commented on issue #793:
URL: https://github.com/apache/mina-sshd/issues/793#issuecomment-3132660686

   Note that pack files in git are also read-only, which may give trouble deleting them on Windows. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [I] GitPackCommand opens Repository without closing it [mina-sshd]

Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf closed issue #793: GitPackCommand opens Repository without closing it
URL: https://github.com/apache/mina-sshd/issues/793


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org