-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 40
-
Fix Version/s: 41
-
Component/s: Versioning & Branch management
-
Tags:
-
Sprint:NOS-25, NOS-26
When the close() method is not called on a jgit Repository (or on the wrapping Git object), the process maintains a lock on .pack files (and maybe others).
This causes different problems depending on the underlying OS :
- On Linux, the .pack file is marked as deleted and doesn't prevent the deletion of the repo
lsof -u ronan |grep "nxruntime.*pack" java 24498 ronan 391r REG 0,43 336 22417108 /home/ronan/dev/sources/nuxeo-connect-priv-MASTER/nuxeo-connect-plugin/target/nxruntime-main-162184526913254447.tmp/data/studio/workspaces/project-0/.git_bare_cache/objects/pack/pack-483c716d2bdd8d81c14eb317a6c97962f93cbf76.pack (deleted)
- On Windows, the file is still here and cannot be deleted, causing other commands to fail on a partially deleted repo
it_should_retrieve_a_branch_snapshot(com.nuxeo.connect.packagerepository.StudioPackageRetrieverTest) Time elapsed: 0.244 sec <<< ERROR! com.nuxeo.studio.exception.VersioningException: target\nxruntime-main-9072057935275143909.tmp\data\studio\workspaces\project-0\project-0-#1-cloned-2016-08-16-17-20-17\.git: Invalid remote: origin at org.eclipse.jgit.transport.TransportLocal$1.open(TransportLocal.java:131) at org.eclipse.jgit.transport.TransportBundleFile$1.open(TransportBundleFile.java:106) at org.eclipse.jgit.transport.Transport.open(Transport.java:560) at org.eclipse.jgit.transport.Transport.open(Transport.java:437) at org.eclipse.jgit.transport.Transport.open(Transport.java:318) at org.eclipse.jgit.transport.Transport.open(Transport.java:287) at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:120) at com.nuxeo.studio.core.versioning.VersioningGitAbstract$4.call(VersioningGitAbstract.java:224) at com.nuxeo.studio.core.versioning.VersioningGitAbstract$4.call(VersioningGitAbstract.java:219) at com.nuxeo.studio.core.versioning.VersioningGitAbstract$GitCommandExecutor.execute(VersioningGitAbstract.java:266) at com.nuxeo.studio.core.versioning.VersioningGitAbstract.refreshLocal(VersioningGitAbstract.java:219) at com.nuxeo.studio.core.versioning.VersioningGitAbstract.resetOnHead(VersioningGitAbstract.java:507) at com.nuxeo.studio.core.versioning.VersioningGitAbstract.resetOnBranch(VersioningGitAbstract.java:530) at com.nuxeo.studio.core.workspace.WorkspaceProvider.switchToBranch(WorkspaceProvider.java:293) at com.nuxeo.studio.core.workspace.DefaultWorkspace.onBranch(DefaultWorkspace.java:139) at com.nuxeo.studio.core.workspace.DefaultWorkspacePool.get(DefaultWorkspacePool.java:214) at com.nuxeo.studio.core.workspace.WorkspaceServiceImpl.getReadOnlyWorkspace(WorkspaceServiceImpl.java:56) at com.nuxeo.studio.core.BranchServiceImpl.getBranches(BranchServiceImpl.java:163) at com.nuxeo.studio.core.BranchServiceImpl.getBranchIfExist(BranchServiceImpl.java:150) at com.nuxeo.studio.core.BranchServiceImpl.createBranch(BranchServiceImpl.java:117) at com.nuxeo.connect.packagerepository.StudioPackageRetrieverTest.it_should_retrieve_a_branch_snapshot(StudioPackageRetrieverTest.java:334)