| Summary: | [server] project delete fails after a git clone | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Anthony Hunter <ahunter.eclipse> |
| Component: | Server | Assignee: | Anthony Hunter <ahunter.eclipse> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 4.0 | ||
| Target Milestone: | 5.0 M1 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Anthony Hunter
The problem also occurs on Linux: % find /workspace/foo -name *.pack /workspace/foo/C/.git/objects/pack/pack-c2ff375bacd2a0263004cd60200b214a3322f6b7.pack % lsof /workspace/foo/C/.git/objects/pack/pack-c2ff375bacd2a0263004cd60200b214a3322f6b7.pack COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME javaw 32079 ahunter 192r REG 8,6 12371 1310845 /workspace/foo/C/.git/objects/pack/pack-c2ff375bacd2a0263004cd60200b214a3322f6b7.pack javaw 32079 ahunter 193r REG 8,6 12371 1310845 /workspace/foo/C/.git/objects/pack/pack-c2ff375bacd2a0263004cd60200b214a3322f6b7.pack javaw 32079 ahunter 195r REG 8,6 12371 1310845 /workspace/foo/C/.git/objects/pack/pack-c2ff375bacd2a0263004cd60200b214a3322f6b7.pack javaw 32079 ahunter 197r REG 8,6 12371 1310845 /workspace/foo/C/.git/objects/pack/pack-c2ff375bacd2a0263004cd60200b214a3322f6b7.pack javaw 32079 ahunter 198r REG 8,6 12371 1310845 /workspace/foo/C/.git/objects/pack/pack-c2ff375bacd2a0263004cd60200b214a3322f6b7.pack javaw 32079 ahunter 200r REG 8,6 12371 1310845 /workspace/foo/C/.git/objects/pack/pack-c2ff375bacd2a0263004cd60200b214a3322f6b7.pack javaw 32079 ahunter 203r REG 8,6 12371 1310845 /workspace/foo/C/.git/objects/pack/pack-c2ff375bacd2a0263004cd60200b214a3322f6b7.pack javaw 32079 ahunter 204r REG 8,6 12371 1310845 /workspace/foo/C/.git/objects/pack/pack-c2ff375bacd2a0263004cd60200b214a3322f6b7.pack In several places we open the git repository on disk by a create() call but do not follow this up with a close(). If done correctly, there should be zero files open after the git operation completes. The end result is a leak of open git files. On windows you cannot delete the clone as these files are locked. Linux allows the the deletion anyway. The problem is caused by not cleaning up after creating and using Git objects. We need to close() when done with a Git Repository and dispose() when done with a Git RevWalk. There are also places where we pass an existing Repository to a new GitJob, resulting in either neither side doing a close(), or the close() failing because it was called twice. The GitJob needs to create it's own Repository. Some jobs do this already, but LogJob and InitJob did not. |