Commit Graph

4862 Commits

Author SHA1 Message Date
Matthias Sohn 3ac44f1b38 Merge branch 'stable-4.5' into stable-4.6
* stable-4.5:
  Prepare 4.5.5-SNAPSHOT builds
  JGit v4.5.4.201711221230-r
  Fix LockFile semantics when running on NFS
  Honor trustFolderStats also when reading packed-refs
  Prepare 4.5.4-SNAPSHOT builds
  JGit v4.5.3.201708160445-r

Change-Id: Ie9c8e0d9172c8d53f075c284bf2a9677980d8dfb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-11-22 21:34:08 +01:00
Matthias Sohn 7608de5e5d Prepare 4.5.5-SNAPSHOT builds
Change-Id: I71f946f2875716670a2d74c21a8ab38a1f53a25c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-11-22 19:27:22 +01:00
Matthias Sohn 6372c60ab2 JGit v4.5.4.201711221230-r
Change-Id: Ia1079da239c5b3fde1ba8d2acc4e465a46297b4d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-11-22 18:31:24 +01:00
Christian Halstrick 10e65cb4fa Fix LockFile semantics when running on NFS
When running on NFS there was a chance that JGits LockFile
semantic is broken because File#createNewFile() may allow
multiple clients to create the same file in parallel. This
change provides a fix which is only used when the new config
option core.supportsAtomicCreateNewFile is set to false. The
default for this option is true. This option can only be set in the
global or the system config file. The repository config file is not
taken into account in this case.

If the config option core.supportsAtomicCreateNewFile is true
then File#createNewFile() is trusted and the behaviour doesn't
change.

But if core.supportsAtomicCreateNewFile is set to false then after
successful creation of the lock file a hardlink to that lock file is
created and the attribute nlink of the lock file is checked to be 2. If
multiple clients manage to create the same lock file nlink would be
greater than 2 showing the error.

This expensive workaround is described in
 https://www.time-travellers.org/shane/papers/NFS_considered_harmful.html
section III.d) "Exclusive File Creation"

Change-Id: I3d2cc48d8eb280d5f7039eb94da37804f903be6a
2017-11-22 18:15:11 +01:00
Christian Halstrick 218cf3403d Honor trustFolderStats also when reading packed-refs
Then list of packed refs was cached in RefDirectory based on mtime of
the packed-refs file. This may fail on NFS when attributes are cached.
A cached mtime of the packed-refs file could cause JGit to trust the
cached content of this file and to overlook that the file is modified.

Honor the config option trustFolderStats and always read the packed-refs
content if the option is false. By default this option is set to true
and this fix is not active.

Change-Id: I2b65cfaa8f4aba2efbf8a5e865d3f09f927e2eec
2017-11-21 21:21:22 +01:00
Matthias Sohn 960d7ff3e5 Prepare 4.5.4-SNAPSHOT builds
Change-Id: Id8b902bf2bf590b41f2e246c5ecf1592e1c411f2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-08-26 08:08:46 +02:00
Matthias Sohn e21e2436d3 JGit v4.5.3.201708160445-r
Change-Id: I2d57144976e3683e180d3a42edc6c3bf2905e87c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-08-16 10:42:27 +02:00
Matthias Sohn 985e3c6414 Merge branch 'stable-4.5' into stable-4.6
* stable-4.5:
  Fix exception handling for opening bitmap index files

Change-Id: Ifb511238e3e98b1bc9f79a990807b940a17ebaa6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-08-14 23:43:05 +02:00
Matthias Sohn d9fd35281b Update Oxygen Orbit p2 repository to R20170516192513
Change-Id: I7f1b733ca414d77c9df5572df02e742e0a84ba2f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-08-14 23:37:21 +02:00
Christian Halstrick 1ed1e40387 Fix exception handling for opening bitmap index files
When creating a new PackFile instance it is specified whether this pack
has an associated bitmap index file or not. This information is cached
and the public method getBitmapIndex() will always assume a bitmap index
file must exist if the cached data tells so. But it may happen that the
packfiles are repacked during a gc in a different process causing the
packfile, bitmap-index and index file to be deleted. Since JGit still
has an open FileHandle on the packfile this file is not really deleted
and can still be accessed. But index and bitmap index file are deleted.
Fix getBitmapIndex() to invalidate the cached packfile instance if such
a situation occurs.

This problem showed up when a gerrit server was serving repositories
which where garbage collected with native git regularly. Fetch and
clone commands for certain repositories failed permanently after a
native git gc had deleted old bitmap index files.

Change-Id: I8e620bec74dd3f310ba42024f9a657062f868f0e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-08-14 21:09:48 +02:00
David Pursehouse c047e2ad2d Merge branch 'stable-4.5' into stable-4.6
* stable-4.5:
  Prepare 4.5.3-SNAPSHOT builds
  JGit v4.5.2.201704071617-r

Change-Id: I4e1915d3a88e15c9ef1fb2b470b7f3b821243ff5
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-04-09 17:22:39 +09:00
Matthias Sohn 3db0f507ee Prepare 4.5.3-SNAPSHOT builds
Change-Id: I69681b7a5687ca76bd0dd5d3e7ce2cff841d0e32
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-04-08 00:31:09 +02:00
Matthias Sohn c1d3ecbeab JGit v4.5.2.201704071617-r
Change-Id: I66402643d7c84c90bf5cefed4d2ec3aa68c94cfb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-04-07 22:17:27 +02:00
Matthias Sohn 1b45b06116 Update Jetty to 9.3.17.v20170317
Update to the latest 9.3 version until we have a solution for bug 514336
we face with 9.4.x versions.

Change-Id: I6d8d476abe8677ce865a08099bb77330effc700a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-04-02 11:53:29 +02:00
Matthias Sohn ebc290a4a0 Revert "Update Jetty to 9.4.1.v20170120 in buck build"
This reverts commit d3b80b951c.

Change-Id: I596ba596f3e857346020e01b0a018d90a0b27edd
2017-04-01 13:03:48 +02:00
David Pursehouse da6fa14fd1 Revert "Update Jetty to 9.4.1.v20170120"
This reverts commit e05caf91f1.

Change-Id: Ia4287f130034a790759b5035505a093b4616a05a
2017-03-31 14:50:20 +09:00
David Pursehouse 7f013924a8 Merge branch 'stable-4.5' into stable-4.6
* stable-4.5:
  Only mark packfile invalid if exception signals permanent problem
  Don't flag a packfile invalid if opening existing file failed
  Prepare 4.5.2-SNAPSHOT builds

Change-Id: I20b50981adc54c426666015ff04fe3bb1db9abd9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-03-27 10:14:50 +09:00
Matthias Sohn aaf3c5154e Only mark packfile invalid if exception signals permanent problem
Add NoPackSignatureException and UnsupportedPackVersionException to
explicitly mark permanent unrecoverable problems with a pack 

Assume problem with a pack is permanent only if we are sure the
exception signals a non-transient problem we can't recover from:
- AccessDeniedException: we lack permissions
- CorruptObjectException: we detected corruption
- EOFException: file ended unexpectedly
- NoPackSignatureException: pack has no pack signature
- NoSuchFileException: file has gone missing
- PackMismatchException: pack no longer matches its index
- UnpackException: unpacking failed
- UnsupportedPackIndexVersionException: unsupported pack index version
- UnsupportedPackVersionException: unsupported pack version

Do not attempt to handle Errors since they are thrown for serious
problems applications should not try to recover from.

Change-Id: I2c416ce2b0e23255c4fb03a3f9a0ee237f7a484a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-03-26 11:40:47 +02:00
Luca Milanesio 363a3657b1 Don't flag a packfile invalid if opening existing file failed
A packfile random file open operation may fail with a
FileNotFoundException even if the file exists, possibly
for the temporary lack of resources.

Instead of managing the FileNotFoundException as any generic
IOException it is best to rethrow the exception but prevent
the packfile for being flagged as invalid until it is actually
opened and read successfully or unsuccessfully.

Bug: 514170
Change-Id: Ie37edba2df77052bceafc0b314fd1d487544bf35
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-03-25 01:33:18 +01:00
Matthias Sohn 11a12ceb0b Prepare 4.5.2-SNAPSHOT builds
Change-Id: I8485de1f3f63dc9ec445b8fb08093ca144aedc59
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-03-25 01:21:58 +01:00
David Pursehouse de7c111303 Merge branch 'stable-4.5' into stable-4.6
* stable-4.5:
  JGit v4.5.1.201703201650-r

Change-Id: Ic9dda2317456308c222928cb8453cb00a231eea1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-03-22 09:44:49 +09:00
Matthias Sohn a9a84b7235 JGit v4.5.1.201703201650-r
Change-Id: I88de7c9f52abbc4921a82208ed74d22aa19fb3cd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-03-20 21:44:47 +01:00
Matthias Sohn 405fdf76d5 Merge branch 'stable-4.5' into stable-4.6
* stable-4.5:
  Don't remove pack when FileNotFoundException is transient

Change-Id: Ic17c542d78a4cad48ff1ed77dcdc853a4ef2dc06
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-03-16 00:26:37 +01:00
Luca Milanesio 4c558225dc Don't remove pack when FileNotFoundException is transient
The FileNotFoundException is typically raised in three conditions:
1. file doesn't exist
2. incompatible read vs. read/write open modes
3. filesystem locking
4. temporary lack of resources (e.g. too many open files)

1. is already managed, 2. would never happen as packs are not
overwritten while with 3. and 4. it is worth logging the exception and
retrying to read the pack again.

Log transient errors using an exponential backoff strategy to avoid
flooding the logs with the same error if consecutive retries to access
the pack fail repeatedly.

Bug: 513435
Change-Id: I03c6f6891de3c343d3d517092eaa75dba282c0cd
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-03-15 23:43:39 +01:00
Matthias Sohn 79f85d1cf2 Prepare 4.6.2-SNAPSHOT builds
Change-Id: I8835f79145e6a989787d47322c3d8cb9baf0624a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-03-07 20:49:24 +01:00
Matthias Sohn 258dc5a715 JGit v4.6.1.201703071140-r
Change-Id: I842dc95313e5b47b0b7ec983c4a0a91915ed4183
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-03-07 17:40:32 +01:00
Jonathan Nieder d3b80b951c Update Jetty to 9.4.1.v20170120 in buck build
5e8e2179b2 (Update Jetty to
9.4.1.v201470120, 2017-01-26) updated Jetty in the maven build.
Update the buck build to match so buck builds work again.

The buck build will go away soon, but in the meantime (until the bazel
build gets the same level of support) it is convenient as a faster way
of running tests than using maven.

The bazel build doesn't need this change since it doesn't build or run
http tests yet.

Change-Id: Ibbdaf2880e76b32fc9f6b5605a2ff29e3deffda2
(cherry picked from commit 2470f01d0f)
2017-03-06 23:36:44 +01:00
Matthias Sohn e05caf91f1 Update Jetty to 9.4.1.v20170120
MappedLoginService is no longer available in Jetty 9.4 therefore base
TestLoginService on AbstractLoginService.

Apparently Jetty now uses slf4j hence adapt RecordingLogger accordingly
so we can log error messages containing slf4j style formatting anchors
"{}".

Change-Id: Ibb36aba8782882936849b6102001a88b699bb65c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
(cherry picked from commit 5e8e2179b2)
2017-03-06 23:30:40 +01:00
Matthias Sohn 14cad02916 Update build to use Tycho 1.0.0
Change-Id: I10f61962e1496f079a39e0f533506816be56e925
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
(cherry picked from commit 92d8c9bec2)
2017-03-06 23:27:20 +01:00
David Pursehouse d15fc9cb7c Update minimum JDK version in README
Change-Id: I655d896b268e946e3492661b08add0ebac22c6f0
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
(cherry picked from commit 67da5635a4)
2017-03-06 23:26:54 +01:00
Matthias Sohn 18cda3888c GC: delete empty directories after purging loose objects
In order to limit the number of directories we check for emptiness only
consider fanout directories which contained unreferenced loose objects
we deleted in the same gc run.

Change-Id: Idf8d512867ee1c8ed40bd55752122ce83a98ffa2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-02-01 23:44:07 +01:00
Matthias Sohn a11bb03127 GC.prune(Set<ObjectId>): return early if objects directory is empty
Change-Id: Id56b102604c4e0437230e3e7c59c0a3a1b676256
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-01-30 00:55:38 +01:00
Hongkai Liu 8fd500e20c Clean up orphan files in GC
An orphan file is either a bitmap or an idx file in pack folder,
and its corresponding pack file is missing.

Change-Id: I3c4cb1f7aa99dd7b398bdb8d513f528d7761edff
Signed-off-by: Hongkai Liu <hongkai.liu@ericsson.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-01-30 00:55:36 +01:00
Matthias Sohn efbecb9764 Update Orbit to S20170120205402 and com.jcraft.jsch to 0.1.54
CQ: 12553
Change-Id: Ie72b48d00f363e3dc05b9733018a6ddca32c3e6e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-01-23 20:29:43 +01:00
Matthias Sohn fd874b4024 Fix preparation of 4.6.1-SNAPSHOT builds
Change-Id: Ib241c4f45192672712526599898c0bd0bd356436
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-01-23 20:29:42 +01:00
Matthias Sohn 16e515a59e Update tycho version to 0.26
Change-Id: I1cf3402c057de89d1afe161d2d4106896fa8753f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-12-26 23:21:46 +01:00
Matthias Sohn dbd859a48d Update maven plugins
Change-Id: I2d18f69d25362f565df071c320970cbc973199cd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-12-26 23:20:17 +01:00
Matthias Sohn 828612355f Skip javadoc generation for org.eclipse.jgit.http.test
This fixes the error the javadoc plugin raises when generating the maven
site for this bundle.

Change-Id: I72026aa33be86960747a246af4a70f6a91b40102
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-12-24 16:00:41 +01:00
Matthias Sohn 3857c3168f Prepare 4.6.1-SNAPSHOT builds
Change-Id: I6b05a6f6c3f92365c272e1bdaf76093ca01f2d58
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-12-24 15:51:54 +01:00
Matthias Sohn 73a4325149 JGit v4.6.0.201612231935-r
Change-Id: Iaa88fe1b195dfe6be99a7b4cb064684e75563715
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-12-24 01:42:38 +01:00
Matthias Sohn 5274da3c3c Merge branch 'stable-4.5'
* origin/stable-4.5:
  Fix one case of missing object

Change-Id: Ia6384f4be71086d5a0a8c42c7521220f57dfd086
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-12-24 00:30:00 +01:00
Matthias Sohn 1fb2319c18 [infer] Fix resource leak in IndexDiff
We only need the tree id to add it to a TreeWalk so change tree's type
to AnyObjectId.

Bug: 509385
Change-Id: I98dd5fef15cd173fe1fd84273f0f48e64e12e608
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-12-21 23:51:50 +01:00
Matthias Sohn 325cb35ccd [infer] Fix resource leak in ObjectChecker
Bug: 509385
Change-Id: I6b6ff5b721d959eb0708003a40c8f97d6826ac46
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-12-21 00:50:21 +01:00
Matthias Sohn f30fe13ac9 [infer] Fix a resource leak in PackWriter
Bug: 509385
Change-Id: Ic8a82895fa39be73f1bd8427cfe9437be6fc4e3e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-12-19 08:38:41 +01:00
Matthias Sohn 6cbc99d3ee [infer] Fix resource leaks in DfsInserter
Bug: 509385
Change-Id: Id5dc40bb3fb9da97ea0795cca1f2bcdcde347767
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-12-19 00:02:43 +01:00
Matthias Sohn a498a2865e [infer] Fix resource leak in ManifestParser
Bug: 509385
Change-Id: Icfe58ac2e5344546448a55ad14ec082356be968c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-12-18 23:02:47 +01:00
Matthias Sohn e78626f414 [infer] Fix resource leak in RepoCommand
Bug: 509385
Change-Id: I30c427f0dd2fc1fceb6b003dfdee0a05efaefca9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-12-18 23:02:45 +01:00
Matthias Sohn 1779fb4a57 [infer] Fix resource leak in DirCache
Bug: 509385
Change-Id: I5f914c910ef3a7583594fb31c7757d3dddf6a05e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-12-18 13:49:37 +01:00
Matthias Sohn aa199ff648 [infer] Fix SubmoduleWalk leaks in submodule commands
Bug: 509385
Change-Id: I4cba81d8ea596800a40799dc9cb763fae01fe508
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-12-18 13:49:36 +01:00
Matthias Sohn fbcc2cb4ca [infer] Fix resource leaks in SubmoduleAddCommand
Bug: 509385
Change-Id: I9d25cf117cfb19df108f5fe281232193fd898474
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-12-18 13:49:33 +01:00