This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 221498 - add release() method to GitClient API
Summary: add release() method to GitClient API
Status: RESOLVED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Git (show other bugs)
Version: 7.3
Hardware: PC Linux
: P2 normal (vote)
Assignee: Ondrej Vrabec
URL:
Keywords: API, API_REVIEW_FAST
Depends on:
Blocks: 218443
  Show dependency tree
 
Reported: 2012-11-05 15:33 UTC by Ondrej Vrabec
Modified: 2012-11-17 02:43 UTC (History)
5 users (show)

See Also:
Issue Type: TASK
Exception Reporter:


Attachments
patch (47.99 KB, patch)
2012-11-05 15:39 UTC, Ondrej Vrabec
Details | Diff
patch (49.08 KB, patch)
2012-11-06 09:07 UTC, Ondrej Vrabec
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ondrej Vrabec 2012-11-05 15:33:26 UTC

    
Comment 1 Ondrej Vrabec 2012-11-05 15:39:05 UTC
Created attachment 127156 [details]
patch
Comment 2 Ondrej Vrabec 2012-11-05 15:39:59 UTC
Please review:
JGit library does not automatically lose opened file descriptors and keeps the metadata files opened until Repository.close() is called. This results in collision with external tools (usually on Windows) such as git command line client. See bug #218443.
We need to add a method to GitClient API that will be called by all API clients when they stop using the GitClient's instance. The idea is that internally the Git library will count usages of GitClients - will count created instances - and when the last GitClient instance will call release() the underlying repository will be closed along with all the opened files.
Comment 3 Tomas Hurka 2012-11-06 08:03:11 UTC
Please do not use finalizer in GitClient.
Comment 4 Ondrej Vrabec 2012-11-06 09:07:07 UTC
Created attachment 127195 [details]
patch

> Please do not use finalizer in GitClient.
...removed
Comment 5 Ondrej Vrabec 2012-11-15 11:42:39 UTC
i will integrate tomorrow if no other comments come
Comment 6 Ondrej Vrabec 2012-11-16 14:14:26 UTC
fix: http://hg.netbeans.org/core-main/rev/2ea01c05055d
Comment 7 Quality Engineering 2012-11-17 02:43:19 UTC
Integrated into 'main-golden', will be available in build *201211170002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/2ea01c05055d
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: #221498 - add release() method to GitClient API
adding GitClient.release method to be able to release any open file descriptors held by JGit