Commit Graph

3027 Commits

Author SHA1 Message Date
Thomas Wolf fc6fe793ce Don't rely on an implicit default character set
JEP 400 (Java 18) will change the default character set to UTF-8
unconditionally.[1] Introduce SystemReader.getDefaultCharset() that
provides the locale-dependent charset the way JEP 400 recommends.

Change all code locations using Charset.defaultCharset() to use the
new SystemReader method instead.

[1] https://openjdk.java.net/jeps/400

Change-Id: I986f97a410d2fc70748b6f93228a2d45ff100b2c
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-10-26 17:49:20 -04:00
Alina Djamankulova 3b960ae72d DFS block cache: fix lock issue and support parallel index loading
This change is a fix to http://git.eclipse.org/r/c/jgit/jgit/+/183562
that was reverted in http://git.eclipse.org/r/c/jgit/jgit/+/184978
due to deadlocks. Separate locks in DfsBlockFile are removed to rely
on getting value from DfsBlockCache with region locking in place.

With this change bitmap index creation is not blocked on index and
reverse index full initialization in DfsPackFile. Now bitmap index
and index could be read from storage in parallel in separate threads.

A unit test is added for parallel index loading.

Signed-off-by: Alina Djamankulova <adjama@google.com>
Change-Id: Ic6d9c5a4a254628636aa98a5008447a27a003f69
2021-10-19 15:01:59 -07:00
Matthias Sohn 8a3158c551 Merge branch 'stable-5.13'
* stable-5.13:
  Fix missing peel-part in lsRefsV2 for loose annotated tags
  Fix RevWalk.getMergedInto() ignores annotated tags
  Optimize RevWalk.getMergedInto()
  reftable: drop code for truncated reads
  reftable: pass on invalid object ID in conversion
  Update eclipse-jarsigner-plugin to 1.3.2
  Fix running benchmarks from bazel
  Update eclipse-jarsigner-plugin to 1.3.2
  Add org.bouncycastle.bcutil to p2 repository

Change-Id: I789e3c84045cc9dcd8a26de34d09fc1e3ccc41e7
2021-10-15 23:10:12 +02:00
Matthias Sohn 78043b07e2 Merge branch 'stable-5.12' into stable-5.13
* stable-5.12:
  Fix missing peel-part in lsRefsV2 for loose annotated tags
  Fix RevWalk.getMergedInto() ignores annotated tags
  Optimize RevWalk.getMergedInto()
  reftable: drop code for truncated reads
  reftable: pass on invalid object ID in conversion
  Update eclipse-jarsigner-plugin to 1.3.2
  Fix running benchmarks from bazel
  Update eclipse-jarsigner-plugin to 1.3.2

Change-Id: Ie5da8d2d07f39ab5aaeca560040637635d4eb04c
2021-10-15 22:58:21 +02:00
Matthias Sohn 91e44e08cf Merge branch 'stable-5.11' into stable-5.12
* stable-5.11:
  Fix missing peel-part in lsRefsV2 for loose annotated tags
  reftable: drop code for truncated reads
  reftable: pass on invalid object ID in conversion
  Update eclipse-jarsigner-plugin to 1.3.2
  Fix running benchmarks from bazel
  Update eclipse-jarsigner-plugin to 1.3.2

Change-Id: I2122b3966bddb10d43d439eb8c5d6cc4583c6ba6
2021-10-15 22:48:01 +02:00
Matthias Sohn 4060936bdd Merge branch 'stable-5.10' into stable-5.11
* stable-5.10:
  Fix missing peel-part in lsRefsV2 for loose annotated tags
  reftable: drop code for truncated reads
  reftable: pass on invalid object ID in conversion
  Update eclipse-jarsigner-plugin to 1.3.2
  Fix running benchmarks from bazel
  Update eclipse-jarsigner-plugin to 1.3.2

Change-Id: I23ccb89306263ce042ce782d881812d4b5187672
2021-10-15 22:45:18 +02:00
Matthias Sohn 50411fa147 Merge branch 'stable-5.9' into stable-5.10
* stable-5.9:
  Fix missing peel-part in lsRefsV2 for loose annotated tags
  reftable: drop code for truncated reads
  reftable: pass on invalid object ID in conversion
  Update eclipse-jarsigner-plugin to 1.3.2
  Fix running benchmarks from bazel
  Update eclipse-jarsigner-plugin to 1.3.2

Change-Id: I4e7c7727ebfa9a7748477f2300bd66d775548ad6
2021-10-15 22:32:00 +02:00
Saša Živkov d160e8a935 Fix missing peel-part in lsRefsV2 for loose annotated tags
We observed the following issue:

  $ git tag -a v1.0 -m v1.0
  $ git push origin tag v1.0
  $ git ls-remote origin v1.0^{}
  ... empty result ...

  On the server (Gerrit) side run git-gc to pack the refs:
  $ git gc

  Repeat the ls-remote from the client and the result is correct:
  $ git ls-remote origin v1.0^{}
  7ad85c810de3ae922903d4bdd17c53cd627260ba        refs/tags/v1.0^{}

Unfortunately, the existing UploadPackTest didn't reveal this issue
although it provided the test case needed to do so: testV2LsRefsPeel.
This is because The UploadPackTest uses InMemoryRepository which
internally uses Dfs* implementations. The issue is only reproducible
when using the FileRepository.

It is a non-trivial task to refactor the UploadPackTest to work against
both InMemoryRepository and FileRepository and this change is not trying
to do that. This change creates a new test:
UploadPackLsRefsFileRepositoryTest and copies the necesssary code from
the UploadPackTest.

Change-Id: Icfc7d0ca63f1524bafe24c9626ce12ea72aa3718
Signed-off-by: Saša Živkov <sasa.zivkov@sap.com>
2021-10-15 22:29:28 +02:00
Alina Djamankulova 7d4f3c22ab DFS block cache: allow multiple passes for blocks before eviction
Let certain pack extensions that are expensive to load from storage
(e.g. pack index, bitmap index) stay in DFS block cache longer than
others by overriding default cache count through DfsBlockCacheConfig

Don't change default behavior when cache override map is empty. Use int
cacheCount instead of boolean hot for Ref<T>

Signed-off-by: Alina Djamankulova <adjama@google.com>
Change-Id: I18062784ec9cc14dbba3e4bb8d9509440cf2d44f
2021-10-08 14:35:01 +02:00
kylezhao 60b81c5a92 Fix RevWalk.getMergedInto() ignores annotated tags
If an annotated tag refers to a commit, we should not ignore it.

Change-Id: I77504f93636e9e984540e7d8535ef301adce6a80
Signed-off-by: kylezhao <kylezhao@tencent.com>
2021-10-08 12:05:48 +02:00
kylezhao c5b3054735 Optimize RevWalk.getMergedInto()
Transitive Relation Definition:
On the DAG of commit history, if A can reach B, C can reach A, then C
can reach B.

Example:
As is shown in the graph below:

  1 - 2 - 3 - 4 (side)
            \
             5 -  6^ (master) - 7 (topic)

Find out which branches is 2 merged into:
After we calculated that master contains 2, we can mark 6 as TEMP_MARK
to avoid unwanted walks.
When we want to figure out if 2 is merge into the topic, the traversal
path would be [7, 6] instead of [7, 6, 5, 3, 2].

Test:
This change can significantly improve performance for tags.
On a copy of the Linux repository, the command 'git tag --contains
<commit>' had the following performance improvement:

commit      | Before   | After   | Rel %
47a44d27ca  | 29251ms  | 6687ms  | -77%
90327e7dff  | 21388ms  | 6256ms  | -70%
f85fac0efa  | 11150ms  | 7338ms  | -34%

The current version ignores tags, even though the tag is a type of
the ref.
Follow-up commits I'll fix it.

Change-Id: Ie6295ca4d16070499912af462239e679a97cce47
Signed-off-by: kylezhao <kylezhao@tencent.com>
Reviewed-by: Christian Halstrick <christian.halstrick@sap.com>
Reviewed-by: Martin Fick <mfick@codeaurora.org>
2021-10-08 12:05:47 +02:00
kylezhao 578b6a79a3 GarbageCollectCommand: add numberOfBitmaps to statistics
Change-Id: I630afac9408c7313d1cecb1b24476f645c94fc27
Signed-off-by: kylezhao <kylezhao@tencent.com>
2021-10-08 11:12:31 +08:00
Matthias Sohn 5a7a5d5ae9 Merge branch 'stable-5.8' into stable-5.9
* stable-5.8:
  reftable: drop code for truncated reads
  reftable: pass on invalid object ID in conversion
  Update eclipse-jarsigner-plugin to 1.3.2

Change-Id: I9e66ef90dc9a65bac47b35705d679bf992bd72b9
2021-10-08 00:36:14 +02:00
Matthias Sohn 721a971d5d Merge branch 'stable-5.7' into stable-5.8
* stable-5.7:
  reftable: drop code for truncated reads
  reftable: pass on invalid object ID in conversion
  Update eclipse-jarsigner-plugin to 1.3.2

Change-Id: I88c47ff57f4829baec5b19aad3d8d6bd21f31a86
2021-10-08 00:33:33 +02:00
Matthias Sohn 4fd8c1406f Merge branch 'stable-5.6' into stable-5.7
* stable-5.6:
  reftable: drop code for truncated reads
  reftable: pass on invalid object ID in conversion
  Update eclipse-jarsigner-plugin to 1.3.2

Change-Id: I1c18f5f435f4a4a86e0548a310dbfc74191e1ed5
2021-10-08 00:18:42 +02:00
Thomas Wolf bdba9edd5f Remove redundant type arguments
In Java 11 type arguments for anonymous subclasses can be inferred
and don't need to be specified. This resolves a number of compiler
warnings.

Change-Id: I55eff3babb7628aa0627085e65a1b45eb12c2cd3
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-09-30 09:31:12 +02:00
Matthias Sohn 81771d8625 IndexDiffWithSymlinkTest: handle InaccessibleObjectException
On Java 16 this test throws InaccessibleObjectException, handle and
ignore it similar to IllegalAccessException.

Change-Id: I19b4f577579694a146516861a7ec567141f3464b
2021-09-29 17:13:05 +02:00
Matthias Sohn 1d280db147 Enable compiler option --release
This ensures the compiler compiles against the public, supported and
documented API for a specific VM version (here 11) [1]. This also means
that
we don't need EE descriptors in Eclipse anymore in order to ensure that
only supported APIs of the selected Java version can be used.

According to [2] if option --release is used --source and --target
options can't be used.

While we are at it also add default value for all new jdt core options
added in Eclipse 4.21.

[1] https://docs.oracle.com/en/java/javase/11/tools/javac.html
[2] https://docs.oracle.com/en/java/javase/14/docs/specs/man/javac.html#option-release

Change-Id: I852a5d7b0a3210751c15d79ec91915b4c01c41e2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-09-29 17:13:01 +02:00
Matthias Sohn f81a3fc91a Bump minimum required Java version to 11
Bug: 569917
Change-Id: Ifdcdb022a3f29321b4d10da1cc34acca68ed7b03
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-09-29 17:12:12 +02:00
Han-Wen Nienhuys 5f8c484136 reftable: drop code for truncated reads
The reftable format is a block based format, but allows for variably
sized blocks. This obviously happens for reflog blocks (which are zlib
compressed), but is also accepted for index blocks: In the spec, this
is motivated as

     To achieve constant O(1) disk seeks for lookups the index must be
     a single level, which is permitted to exceed the file's
     configured block size, but not the format's max block size of
     15.99 MiB.

Hence, when parsing a block, one cannot be sure of its exact size:
after reading a default-size block (eg. 4kb), the block header may
state that the block is in fact larger.

Before, the code would mark the block as `truncated`, noting

     // Its OK during sequential scan for an index block to have been
     // partially read and be truncated in-memory. This happens when
     // the index block is larger than the file's blockSize. Caller
     // will break out of its scan loop once it sees the blockType.

This looks like either

* a remnant of never-implemented functionality. There is no reason to
  ever sequentially scan an index block.

* alluding to sequential scan of the data blocks before the index
  blocks (eg. scanning refs, which ends when we find the first ref index
  block, and we can then ignore the index block).

This comment is followed by code that populates the
restartTbl/restartCnt fields relative to the (possibly truncated)
buffer. If the buffer is truncated, this essentially reads garbage,
leading to OOB array access when using the index block.

Fix this by dropping the truncated logic and issuing a second read if
the first read was short.

Add a test.

We have never observed this failure scenario at Google. We use 64kb
blocksize, which requires us to need fewer index entries. The reftable
spec mentions an Android repo of size 36M. With 64kb blocks, that's
just 562 index entries. Even with historical growth, we are long from
requiring an index whose size exceeds a single block.

When adding the analogous test for seeking refs, there was no failure.
This points to another possibility which is that the code tries to
avoid writing large index blocks for refs.

I did not investigate further which one it is.

Fixes https://bugs.eclipse.org/bugs/show_bug.cgi?id=576250

Bug: 576250
Change-Id: I41ec21fac9e526ef57b3d6fb57b988bd353ee338
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2021-09-28 20:35:02 +02:00
Han-Wen Nienhuys b4782d74fd reftable: pass on invalid object ID in conversion
Before, while trying to determine if an object ID was a tag or not,
the reftable conversion would yield an exception.

Change-Id: I3688a0ffa9e774ba27f320e3840ff8cada21ecf0
2021-09-27 11:30:13 -04:00
Matthias Sohn a19494b735 Merge branch 'master' into next
* master: (38 commits)
  Revert "DFS block cache: Refactor to enable parallel index loading"
  GitServlet: allow to override default error handlers
  Silence API error for new interface method ProtocolV2Hook#onObjectInfo
  transport: add object-info capability
  Ignore IllegalStateException if JVM is already shutting down
  Update orbit to R20210825222808 for 2021-09
  Update spotbugs-maven-plugin to 4.3.0
  Update ant to 1.10.11 also in pom.xml
  DFS block cache: add additional stats to DfsReaderIoStats
  Update Orbit to S20210817231813
  [gpg] Better GPG home directory determination
  FS: cleanup use of final modifier
  Ensure FS#searchPath only selects executable files
  RevWalk: getMergedInto's result is wrong on the second call
  DFS block cache: Refactor to enable parallel index loading
  [test] Create keystore with the keytool of the running JDK
  [gpg] Update to Bouncy Castle 1.69
  [test] Create keystore with the keytool of the running JDK
  [sshd] Minor code clean-up
  Support commit.template config property
  ...

Change-Id: I9f99e9a513a23c0c0d252334e79c351512d7355e
2021-09-13 23:53:34 +02:00
Matthias Sohn 81cd70d5d0 Prepare 5.13.1-SNAPSHOT builds
Change-Id: Ib2f689d8d13eab022da5b5e83d6d6bebc1bb81d3
2021-09-08 20:24:36 +02:00
Matthias Sohn b3d51a399e JGit v5.13.0.202109080827-r
Change-Id: If3b2d4256712cc7e577c23e75c0d4ad940870e72
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-09-08 14:27:06 +02:00
Matthias Sohn efdc03e164 Prepare 5.13.0-SNAPSHOT builds
Change-Id: I2a1d7ab24d5ca718348f4ce3cda351553e48cd1f
2021-09-01 20:00:56 +02:00
Matthias Sohn 4949a295df JGit v5.13.0.202109011149-rc1
Change-Id: Id8d0970102f18e61a2fc7cf941267c9089d71c1a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-09-01 16:49:12 +02:00
Bruno Albuquerque 5b8e387c67 transport: add object-info capability
Sometimes it is useful to obtain metadata associated with an object
without the need to first download it locally. This is specially useful
when using partial clones.

This change implements the object-info capability that allows clients to
query the remote server for object metadata (currently only size). This
is a backport of the same capability that was recently added to the Git
project a2ba162cda (object-info: support for retrieving object info,
2021-04-20).

Signed-off-by: Bruno Albuquerque <bga@google.com>
Change-Id: I4dc9828e1c247f08b0976b8810be92d124366165
2021-08-31 14:36:06 -07:00
Matthias Sohn c1961ad809 Merge branch 'stable-5.12'
* stable-5.12:
  RevWalk: getMergedInto's result is wrong on the second call

Change-Id: Iee51703b2b009df15c0d8ee19fd480058b665bce
2021-08-30 22:25:02 +02:00
kylezhao 35eeab41b3 RevWalk: getMergedInto's result is wrong on the second call
Make sure the future user can reset all UNINTERESTING commmits after
this operation.

Signed-off-by: kylezhao <kylezhao@tencent.com>
Change-Id: I7549b9ff67bd31acd5dfc92331cb9a30b47b8278
2021-08-13 10:51:16 +08:00
Thomas Wolf 1825a2230c Merge branch 'stable-5.12'
* stable-5.12:
  [test] Create keystore with the keytool of the running JDK
  Fix garbage collection failing to delete pack file
  ReachabilityCheckerTestCase: fix reachable from self test case

Change-Id: I4b54f4850819736144edb784617ee902f491ffd6
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-29 18:19:23 +02:00
Thomas Wolf 65de0d4863 Merge branch 'stable-5.11' into stable-5.12
* stable-5.11:
  [test] Create keystore with the keytool of the running JDK
  ReachabilityCheckerTestCase: fix reachable from self test case

Change-Id: Ie8db450a1fad05bddb812a55b2ceb03b2805403a
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-29 13:12:13 +02:00
Thomas Wolf 1a963b3976 Merge branch 'stable-5.10' into stable-5.11
* stable-5.10:
  [test] Create keystore with the keytool of the running JDK
  ReachabilityCheckerTestCase: fix reachable from self test case

Change-Id: I55f4dd19e9fa3b789bd9a79d256fe9abb55ee7f4
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-29 13:11:37 +02:00
Thomas Wolf bae2f86ac7 Merge branch 'stable-5.9' into stable-5.10
* stable-5.9:
  [test] Create keystore with the keytool of the running JDK
  ReachabilityCheckerTestCase: fix reachable from self test case

Change-Id: Ic37426211905d987ddd11480a54d95b86143c94c
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-29 13:10:56 +02:00
Thomas Wolf 59aec9b15a Merge branch 'stable-5.8' into stable-5.9
* stable-5.8:
  [test] Create keystore with the keytool of the running JDK
  ReachabilityCheckerTestCase: fix reachable from self test case

Change-Id: If09cbb877c674f15261715cecef7a2393bf66fa3
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-29 13:10:16 +02:00
Thomas Wolf 60bffc2fa8 Merge branch 'stable-5.7' into stable-5.8
* stable-5.7:
  [test] Create keystore with the keytool of the running JDK
  ReachabilityCheckerTestCase: fix reachable from self test case

Change-Id: I32010c6bf45d5138e17143d6c284ac56434eade1
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-29 13:09:39 +02:00
Thomas Wolf ae56213210 Merge branch 'stable-5.6' into stable-5.7
* stable-5.6:
  [test] Create keystore with the keytool of the running JDK
  ReachabilityCheckerTestCase: fix reachable from self test case

Change-Id: I1f6b4fc26f6ee6f22cc0aacd032c1e73ba246dbc
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-29 13:09:00 +02:00
Julian Ruppel e2798413f9 Support commit.template config property
Adds functionality to read the git commit.template property. The
template content is read either via a default encoding or, if present,
via encoding specified by i18n.commitEncoding property.

Bug: 446355

Change-Id: I0c45db98e324ddff26a7e0262835f259d6528a86
Signed-off-by: Julian Ruppel <julian.ruppel@sap.com>
2021-07-21 15:50:02 -04:00
Matthias Sohn ca969ecc61 Relax version range for hamcrest and assertj
We currently cannot use hamcrest 2.2 and assertj 3.20.2 (which requires
hamcrest 2.2) in egit tests since other Eclipse dependencies (e.g.
swtbot) require hamcrest 1.1.

Hence relax version range for these components in jgit so that jgit
tests also work when using the egit target platform.

Change-Id: I521e2ec4491bd8d790609b8a66a8f14511a865a1
2021-07-19 12:32:26 +02:00
Matthias Sohn e0ba98edd2 Update orbit to I20210711110031
and update
- assertj to 3.20.2.v20210706-1104
- hamcrest to 2.2.0.v20210711-0821
  - classes which were in org.hamcrest.core 1.3 and org.hamcrest.library
    1.3 were all moved to org.hamcrest in 2.2
  - the annotation org.hamcrest.Factory was removed and is no longer
    needed
  - junit 4.13 requires hamcrest-core and hamcrest-library 1.3 therefore
    keep them in the target platform

CQ: 23501
Change-Id: Ife871c0343b611be9203aed7f86577e85bbf5c95
2021-07-16 23:47:29 +02:00
Matthias Sohn b9653ccdad Merge branch 'master' into next
* master:
  searchForReuse might impact performance in large repositories
  Retry loose object read upon "Stale file handle" exception
  Ignore missing javadoc in test bundles
  Upgrade maven-dependency-plugin to 3.2.0
  Upgrade jacoco-maven-plugin to 0.8.7
  Upgrade maven-jxr-plugin to 3.1.1
  Fix garbage collection failing to delete pack file
  Fix PathSuffixFilter: can decide only on full paths
  Update jetty to 9.4.42.v20210604
  [sshd] Log the full KEX negotiation result
  [releng] japicmp: update last release version
  CONTRIBUTING: add explicit link to ECA
  CONTRIBUTING: Use standard markdown format
  Add Eclipse code of conduct and security policy

Change-Id: I9e31cb6e22f5398db6e220f71693e87475c598bd
2021-06-29 20:26:50 +02:00
Matthias Sohn d46af8c69d Merge branch 'stable-5.12'
* stable-5.12:
  Retry loose object read upon "Stale file handle" exception
  Ignore missing javadoc in test bundles

Change-Id: I67c613c066a3252f9b0d0a3dcc026b57e10bfe1d
2021-06-26 16:37:59 +02:00
Matthias Sohn 8bd0161c83 Merge branch 'stable-5.11' into stable-5.12
* stable-5.11:
  Retry loose object read upon "Stale file handle" exception
  Ignore missing javadoc in test bundles

Change-Id: Ia4dc886c920cec3c9da86e1a90a0af68bd016b4f
2021-06-26 16:36:55 +02:00
Matthias Sohn e6ace4a96d Merge branch 'stable-5.10' into stable-5.11
* stable-5.10:
  Retry loose object read upon "Stale file handle" exception
  Ignore missing javadoc in test bundles

Change-Id: Ia385fa6b5d2fee64476793e06860a279bf2f6e36
2021-06-26 16:35:20 +02:00
Matthias Sohn bbb1c7f645 Merge branch 'stable-5.9' into stable-5.10
* stable-5.9:
  Retry loose object read upon "Stale file handle" exception
  Ignore missing javadoc in test bundles

Change-Id: I56fc2c47193a891285a705d44b3507f23982dc8a
2021-06-25 22:23:47 +02:00
Fabio Ponciroli 6976a30f44 searchForReuse might impact performance in large repositories
The search for reuse phase for *all* the objects scans *all*
the packfiles, looking for the best candidate to serve back to the
client.

This can lead to an expensive operation when the number of
packfiles and objects is high.

Add parameter "pack.searchForReuseTimeout" to limit the time spent
on this search.

Change-Id: I54f5cddb6796fdc93ad9585c2ab4b44854fa6c48
2021-06-25 17:57:59 +02:00
Antonio Barone 24d6d60538 Retry loose object read upon "Stale file handle" exception
When reading loose objects over NFS it is possible that the OS syscall
would fail with ESTALE errors: This happens when the open file
descriptor no longer refers to a valid file.

Notoriously it is possible to hit this scenario when git data is shared
among multiple clients, for example by multiple gerrit instances in HA.

If one of the two clients performs a GC operation that would cause the
packing and then the pruning of loose objects, the other client might
still hold a reference to those objects, which would cause an exception
to bubble up the stack.

The Linux NFS FAQ[1] (at point A.10), suggests that the proper way to
handle such ESTALE scenarios is to:

"[...] close the file or directory where the error occurred, and reopen
it so the NFS client can resolve the pathname again and retrieve the new
file handle."

In case of a stale file handle exception, we now attempt to read the
loose object again (up to 5 times), until we either succeed or encounter
a FileNotFoundException, in which case the search can continue to
Packfiles and alternates.

The limit of 5 provides an arbitrary upper bounds that is consistent to
the one chosen when handling stale file handles for packed-refs
files (see [2] for context).

[1] http://nfs.sourceforge.net/
[2] https://git.eclipse.org/r/c/jgit/jgit/+/54350

Bug: 573791
Change-Id: I9950002f772bbd8afeb9c6108391923be9d0ef51
2021-06-24 23:52:22 +02:00
Matthias Sohn 12f39c26b0 Ignore missing javadoc in test bundles
Change-Id: I83ed20823dc6b22ff48c2a554acb2f7d3b6067b7
2021-06-24 23:14:13 +02:00
Thomas Wolf fc57689774 Fix PathSuffixFilter: can decide only on full paths
On a subtree, a PathSuffixFilter must return -1 ("indeterminate"),
not 0 ("include"), otherwise negation goes wrong: an indeterminate
result (-1) is passed on, but a decision (0/1) is inverted.

As a result a negated PathSuffixFilter would skip all folders.

Bug: 574253
Change-Id: I27fe785c0d772392a5b5efe0a7b1c9cafcb6e566
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-06-21 13:03:22 +02:00
Han-Wen Nienhuys ae081b8dc1 ReachabilityCheckerTestCase: fix reachable from self test case
Change-Id: I8f94a0a0ff401f1691b3757002756b4e83dd8640
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2021-06-16 17:45:29 +02:00
Matthias Sohn 6a8afeb9f2 Merge branch 'master' into next
* master: (47 commits)
  Fix @since from commit 64d0aaa2
  Prepare 5.13.0-SNAPSHOT builds
  Prepare 5.12.1-SNAPSHOT builds
  Teach independent negotiation (no pack file) using an option "wait-for-done"
  JGit v5.12.0.202106070339-r
  [license-check] Update list of project dependencies
  [errorprone] Fix warning InputStreamSlowMultibyteRead
  [errorprone] Make operator precedence explicit in OpenSshConfigFile
  Update jetty to 9.4.41.v20210516
  Prepare 5.1.17-SNAPSHOT builds
  JGit v5.1.16.202106041830-r
  Update Orbit to R20210602031627
  Prepare 5.12.0-SNAPSHOT builds
  Fixing visibility for HostEntry constructors.
  JGit v5.12.0.202106021050-rc1
  Prepare 5.12.0-SNAPSHOT builds
  JGit v5.12.0.202106011439-rc1
  Clarify operator precedence to fix errorprone error
  Prepare 5.12.0-SNAPSHOT builds
  Update Orbit to S20210518003616 and ant to 1.10.10.v20210426-1926
  ...

Change-Id: I76a1f155201648a62df11a41a9e02d97f522d00f
2021-06-15 00:05:14 +02:00