aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Persist minimal racy threshold and allow manual configurationMatthias Sohn2019-08-0612-94/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To enable persisting the minimal racy threshold per FileStore add a new config option to the user global git configuration: - Config section is "filesystem" - Config subsection is concatenation of - Java vendor (system property "java.vendor") - Java version (system property "java.version") - FileStore's name, on Windows we use the attribute volume:vsn instead since the name is not necessarily unique. - separated by '|' e.g. "AdoptOpenJDK|1.8.0_212-b03|/dev/disk1s1" The same prefix is used as for filesystem timestamp resolution, so both values are stored in the same config section - The config key for minmal racy threshold is "minRacyThreshold" as a time value, supported time units are those supported by DefaultTypedConfigGetter#getTimeUnit - measure for 3 seconds to limit runtime which depends on hardware, OS and Java version being used If the minimal racy threshold is configured for a given FileStore the configured value is used instead of measuring it. When the minimal racy threshold was measured it is persisted in the user global git configuration. Rename FileStoreAttributeCache to FileStoreAttributes since this class is now declared public in order to enable exposing all attributes in one object. Example: [filesystem "AdoptOpenJDK|11.0.3|/dev/disk1s1"] timestampResolution = 7000 nanoseconds minRacyThreshold = 3440 microseconds Change-Id: I22195e488453aae8d011b0a8e3276fe3d99deaea Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Also-By: Marc Strapetz <marc.strapetz@syntevo.com>
* Measure minimum racy interval to auto-configure FileSnapshotMatthias Sohn2019-08-0612-86/+245
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By running FileSnapshotTest#detectFileModified we found that the sum of measured filesystem timestamp resolution and measured clock resolution may yield a too small interval after a file has been modified which we need to consider racily clean. In our tests we didn't find this behavior on all systems we tested on, e.g. on MacOS using APFS and Java 8 and 11 this effect was not observed. On Linux (SLES 15, kernel 4.12.14-150.22-default) we collected the following test results using Java 8 and 11: In 23-98% of 10000 test runs (depending on filesystem type and Java version) the test failed, which means the effective interval which needs to be considered racily clean after a file was modified is larger than the measured file timestamp resolution. "delta" is the observed interval after a file has been modified but FileSnapshot did not yet detect the modification: "resolution" is the measured sum of file timestamp resolution and clock resolution seen in Java. Java version filesystem failures resolution min delta max delta 1.8.0_212-b04 btrfs 98.6% 1 ms 3.6 ms 6.6 ms 1.8.0_212-b04 ext4 82.6% 3 ms 1.1 ms 4.1 ms 1.8.0_212-b04 xfs 23.8% 4 ms 3.7 ms 3.9 ms 1.8.0_212-b04 zfs 23.1% 3 ms 4.8 ms 5.0 ms 11.0.3+7 btrfs 98.1% 3 us 0.7 ms 4.7 ms 11.0.3+7 ext4 98.1% 6 us 0.7 ms 4.7 ms 11.0.3+7 xfs 98.5% 7 us 0.1 ms 8.0 ms 11.0.3+7 zfs 98.4% 7 us 0.7 ms 5.2 ms Mac OS 1.8.0_212 APFS 0% 1 s 11.0.3+7 APFS 0% 6 us The observed delta is not distributed according to a normal gaussian distribution but rather random in the observed range between "min delta" and "max delta". Run this test after measuring file timestamp resolution in FS.FileAttributeCache to auto-configure JGit since it's unclear what mechanism is causing this effect. In FileSnapshot#isRacyClean use the maximum of the measured timestamp resolution and the measured "delta" as explained above to decide if a given FileSnapshot is to be considered racily clean. Add a 30% safety margin to ensure we are on the safe side. Change-Id: I1c8bb59f6486f174b7bbdc63072777ddbe06694d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Reuse FileUtils to recursively delete files created by testsMatthias Sohn2019-07-261-23/+19
| | | | | | | Replace redundant complex implementation of recursive delete by the one in FileUtils. Change-Id: Iced1468b96c4f32381a9cf0c651b2bf6a9a9af35 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix FileAttributeCache.toString()Matthias Sohn2019-07-261-6/+3
| | | | | | | We should not list the complete cache but only show the cache entry at hand. Change-Id: I22be2a4dcbf0145155e23f2389bfcf5662cf23a6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add test for racy git detection in FileSnapshotMatthias Sohn2019-07-265-2/+350
| | | | | | | | | | | | | | | Repeat the test 10000 times to get statistics if measured fsTimestampResolution is working in practice to detect racy git situations. Add a class to compute statistics for this test. Log delta between lastModified and time when FileSnapshot failed to detect modification. This happens if the racy git limit determined by measuring filesystem timestamp resolution and clock resolution is too small. If it would be correct FileSnapshot would always detect modification or mark it modified if time since modification is smaller than the racy git limit. Change-Id: Iabe7af1a7211ca58480f8902d4fa4e366932fc77 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Repeat RefDirectoryTest.testGetRef_DiscoversModifiedLoose 100 timesMatthias Sohn2019-07-241-0/+2
| | | | | | This should help to detect if measured fsTimeResolution is too small. Change-Id: Id1f54dbdedb52b17859904e47776fa3a5887b8be Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix org.eclipse.jdt.core.prefs of org.eclipse.jgit.junitMatthias Sohn2019-07-241-9/+20
| | | | | | | Use the same JDT core settings as used in org.eclipse.jgit but ignore non-externalized strings. Change-Id: If30013c76a197e571601a8abc882ac6a99592374 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add missing javadoc in org.eclipse.jgit.junitMatthias Sohn2019-07-242-0/+157
| | | | Change-Id: Ib709ef050bec31c87f542fb2cc977863dda93ef9 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Enhance RepeatRule to report number of failures at the endMatthias Sohn2019-07-192-3/+34
| | | | | | | | | | In order to enable counting how frequently a test fails if repeated add option abortOnFailure. If it is true the test aborts on the first failure. Otherwise it runs the configured number of repetitions and, if there was any failure, throws a RepeatException reporting how many of the test repetitions failed. Change-Id: Ic47de44d4a6273fddf04b9993ad989903efb40c3 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix FileSnapshotTests for filesystem with high timestamp resolutionMatthias Sohn2019-07-191-2/+14
| | | | | | | | | When filesystem timestamp resolution is very high some tests don't work since runtime of the test setup is too long to reach a racily clean FileSnapshot. Hence skip these tests when timestamp resolution is higher than 10 millisecond. Change-Id: Ie47dd10eda22037b5c1ebff6b6becce0654ea807 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Retry deleting test files in FileBasedConfigTestMatthias Sohn2019-07-191-1/+1
| | | | Change-Id: I304b2b6f2e39f72f620bba53aead60256aed3660 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Measure filesystem timestamp resolution already in test setupMatthias Sohn2019-07-195-1/+16
| | | | | | | This helps to avoid some time critical tests can't prepare the test fixture intended since measuring timestamp resolution takes time. Change-Id: Ib34023e682a106070ca97e98ef16789a4dfb97b4 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Refactor FileSnapshotTest to use NIO APIsMatthias Sohn2019-07-192-89/+93
| | | | | | | | - use Path instead of File - create test directories, files and output stream using Files methods - delete unused list "files" Change-Id: I8c5c601eca9f613efb5618d33b262277df92a06a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Measure stored timestamp resolution instead of time to touch fileMatthias Sohn2019-07-191-25/+24
| | | | | | | | | | | | | | | Measure granularity of timestamps stored in the filesystem by setting and then getting lastModified timestamp until the read value changed. Increase increment exponentially to limit number of iterations starting with 1 microsecond since Java's FileTime (up to Java 12) truncates timestamps to 1 microsecond resolution. The chosen algorithm yields 2000 steps between 1 ms and 2.5 s. Also measure clock resolution and add that for the total timestamp resolution. This avoids systematic measurement errors introduced by doing IO to touch a file. Change-Id: I9b37138619422452373e298d9d8c7cb2c384db3f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Handle CancellationException in FileStoreAttributeCacheMatthias Sohn2019-07-191-1/+2
| | | | Change-Id: If5985fbf04f630b1d72a1bafd508e0e15e1436be
* Fix FileSnapshot#saveNoConfigMatthias Sohn2019-07-191-1/+1
| | | | | | | We should not use configuration when creating FileSnapshot when accessing FileBasedConfig. Change-Id: Ic521632870f18bb004751642b9d30648dd94049a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Use Instant for smudge time in DirCache and DirCacheEntryMatthias Sohn2019-07-183-11/+39
| | | | Change-Id: I98050a51baf4726c5717ef62ce7f026173666bdf Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Use Instant instead of milliseconds for filesystem timestamp handlingMatthias Sohn2019-07-1850-290/+783
| | | | | | | | | | | | | | | | This enables higher file timestamp resolution on filesystems like ext4, Mac APFS (1ns) or NTFS (100ns) providing high timestamp resolution on filesystem level. Note: - on some OSes Java 8,9 truncate milliseconds, see https://bugs.openjdk.java.net/browse/JDK-8177809, fixed in Java 10 - UnixFileAttributes truncates timestamp resolution to microseconds when converting the internal representation to FileTime exposed in the API, see https://bugs.openjdk.java.net/browse/JDK-8181493 - WindowsFileAttributes also provides only microsecond resolution Change-Id: I25ffff31a3c6f725fc345d4ddc2f26da3b88f6f2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Workaround SecurityException in FS#getFsTimestampResolutionMatthias Sohn2019-07-171-1/+1
| | | | | | | | | On Android FS#getFsTimestampResolution always throws a SecurityException, handle this by falling back to the fallback timestamp resolution. Bug: 548947 Change-Id: I0ee6cb3c20e189bdc8d488434a930427ad6f2df2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix NPE in FS$FileStoreAttributeCache.getFsTimestampResolutionMatthias Sohn2019-07-172-0/+9
| | | | | | Bug: 548682 Change-Id: I48840d3a68cf1db92c056d218a0d5ed0b9ea4c45 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* FS: ignore AccessDeniedException when measuring timestamp resolutionMatthias Sohn2019-07-171-0/+3
| | | | | | | | | It seems on cygwin creating a file under a writable directory can fail with AccessDeniedException. Log a warning in this case and fallback to worst case timestamp resolution of 2 seconds. Bug: 548648 Change-Id: Ic50c31ce9dc9ccadd4db5247df929418ac62d45c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add debug trace for FileSnapshotMatthias Sohn2019-07-172-12/+51
| | | | | | | | | | | Checking lastModified is time critical hence debug trace is the only way to analyze issues since debugging is impractical. Also add configuration for buffering of log4j output to reduce runtime impact when debug trace is on. Limit buffer to 1MiB and comment this configuration out since we may not always want to use buffering. Change-Id: Ib1a0537b67c8dc3fac994a77b42badd974ce6c97 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Use FileChannel.open to touch file and set mtime to nowMatthias Sohn2019-07-173-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | Use options - StandardOpenOption.CREATE to create touched file if not existing - StandardOpenOption.SYNC to enforce synch of data and meta data changes - StandardOpenOption.WRITE Also set mtime explicitly in FileUtils#touch to the current system time. This should fix that the previous implementation didn't work on - locally cached Windows network share (CSC-CACHE filesystem) mapped as a drive - nfsv4 mounts on Linux and that it didn't create unborn file like Linux command "touch". Apache common's and Guava's touch() use the same approach. Immediately after creating the probe file used to measure timestamp resolution touch it. This ensures we always use the local system clock when measuring filesystem timestamp resolution. This should prevent that clock skew could influence the measured timestamp resolution in case of a mounted network filesystem. Bug: 548598 Change-Id: Iaeaf5967963f582395a195aa637b8188bfadac60 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Persist filesystem timestamp resolution and allow manual configurationMatthias Sohn2019-07-178-11/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To enable persisting filesystem timestamp resolution per FileStore add a new config section to the user global git configuration: - Config section is "filesystem" - Config subsection is concatenation of - Java vendor (system property "java.vm.vendor") - runtime version (system property "java.vm.version") - FileStore's name - separated by '|' e.g. "AdoptOpenJDK|1.8.0_212-b03|/dev/disk1s1" The prefix is needed since some Java versions do not expose the full timestamp resolution of the underlying filesystem. This may also depend on the underlying operating system hence concrete key values may not be portable. - Config key for timestamp resolution is "timestampResolution" as a time value, supported time units are those supported by DefaultTypedConfigGetter#getTimeUnit If timestamp resolution is already configured for a given FileStore the configured value is used instead of measuring the resolution. When timestamp resolution was measured it is persisted in the user global git configuration. Example: [filesystem "AdoptOpenJDK|1.8.0_212-b03|/dev/disk1s1"] timestampResolution = 1 seconds If locking the git config file fails retry saving the resolution up to 5 times in order to workaround races with another thread. In order to avoid stack overflow use the fallback filesystem timestamp resolution when loading FileBasedConfig which creates itself a FileSnapshot to help checking if the config changed. Note: - on some OSes Java 8,9 truncate to milliseconds or seconds, see https://bugs.openjdk.java.net/browse/JDK-8177809, fixed in Java 10 - UnixFileAttributes up to Java 12 truncates timestamp resolution to microseconds when converting the internal representation to FileTime exposed in the API, see https://bugs.openjdk.java.net/browse/JDK-8181493 - WindowsFileAttributes also provides only microsecond resolution up to Java 12 Hence do not attempt to manually configure a higher timestamp resolution than supported by the Java version being used at runtime. Bug: 546891 Bug: 548188 Change-Id: Iff91b8f9e6e5e2295e1463f87c8e95edf4abbcf8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Increase bazel timeout for long running testsMatthias Sohn2019-07-161-0/+4
| | | | | | | | | EolRepositoryTest and GcCommitSelectionTest timed out frequently when running unit tests using bazel with the default timeout "moderate" (300s). Increase timeout of these tests to "long" (900s). Change-Id: I43588cf950f55b50f868d9fe9c66d22bd428a54c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Bazel: Fix lint warning flagged by buildifierDavid Ostrovsky2019-07-162-8/+8
| | | | | | | | | | | | | | | | | | | | This change is fixing confusing name warning: [1]. ./org.eclipse.jgit.test/tests.bzl:12: confusing-name: Never use 'l', 'I', or 'O' as names (they're too easily confused with 'I', 'l', or '0'). And is also fixing: "All calls to rules or macros should pass arguments by keyword position argument" warning: [2]. ./org.eclipse.jgit.test/BUILD:42: positional-args: All calls to rules or macros should pass arguments by keyword (arg_name=value) syntax. [1] https://github.com/bazelbuild/buildtools/blob/master/WARNINGS.md#confusing-name [2] https://github.com/bazelbuild/buildtools/blob/master/WARNINGS.md#positional-args Change-Id: If5c28ec8a1ddc1d1b1035bd07b838a2a564aea4f Signed-off-by: David Ostrovsky <david@ostrovsky.org>
* Update bazlets to latest versionDavid Ostrovsky2019-07-161-1/+1
| | | | | | | | This is needed to make build tool chain compatible with the latest Bazel releases. Change-Id: I9822b5fe5f934457e6069217d687b3cf4764b7b7 Signed-off-by: David Ostrovsky <david@ostrovsky.org>
* Bazel: Add missing dependencies for ArchiveCommandTestDavid Pursehouse2019-07-162-0/+7
| | | | | | | | Dependencies on commons-compress, xz, and jgit-archive are required for the build to succeed. Change-Id: I42f3721078a240ad93b8dcab909e66b9bfff0b56 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Bazel: Remove FileTreeIteratorWithTimeControl from BUILD fileDavid Pursehouse2019-07-161-1/+0
| | | | | | | | | FileTreeIteratorWithTimeControl was deleted in a024759, but was not removed from the BUILD file, thus causing the bazel build to fail. Change-Id: I892c0ffcac947298d0d6009374ee2c5d9afefb66 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Add support for nanoseconds and microseconds for Config#getTimeUnitMatthias Sohn2019-07-112-0/+20
| | | | Change-Id: I0a5828438810dd23790cba52d7ae2e055c6a3fc9 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Optionally measure filesystem timestamp resolution asynchronouslyMatthias Sohn2019-07-112-51/+144
| | | | | | | | | | | | | In order to avoid blocking on the main thread during measurement interactive applications like EGit may want to measure the filesystem timestamp resolution asynchronously. In order to enable measurement in the background call FileStoreAttributeCache.setAsyncfileStoreAttrCache(true) before the first access to cached FileStore attributes. Bug: 548188 Change-Id: I8c9a2dbfc3f1d33441edea18b90e36b1dc0156c7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Delete unused FileTreeIteratorWithTimeControlMatthias Sohn2019-07-112-177/+0
| | | | | | | The only usage of this test iterator was removed in df637928d. Hence delete this iterator and associated test. Change-Id: I47710133ec3edc675c21db210960c024982668c6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* FileSnapshot#equals: consider UNKNOWN_SIZEHan-Wen Nienhuys2019-07-092-2/+14
| | | | | | | | | | | | | | | | Add a unittest. In commit I5485db55 ("Fix FileSnapshot's consideration of file size"), the special casing of UNKNOWN_SIZE was forgotten. This change, together with I493f3b57b ("Measure file timestamp resolution used in FileSnapshot") introduced a regression that would occasionally surface in Gerrit integration tests marked UseLocalDisk, with the symptom that creating the Admin user in NoteDb failed with a LOCK_FAILURE. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Change-Id: I7ffd972581f815c144f810481103c7985af5feb0
* Timeout measuring file timestamp resolution after 2 secondsMatthias Sohn2019-07-033-2/+17
| | | | | | | | | It was reported that measuring file timestamp resolution may hang indefinitely on nfs. Hence timeout this measurement at the known worst filesystem timestamp resolution (FAT) of 2 seconds. Bug: 548188 Change-Id: I17004b0aa49d5b0e76360a008af3adb911b289c0 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix RacyGitTests#testRacyGitDetectionMatthias Sohn2019-07-031-11/+26
| | | | | | | | | | | | | | This test case assumed file system timestamp resolution of 1 second. On filesystems with a finer resolution this test fails since the index entry is only smudged if the file index entry's lastModified and the lastModified of the git index itself are within the same filesystem timer tick. Fix this by ensuring that these timestamps are identical which should work for any filesystem timer resolution. Bug: 548188 Change-Id: Id84d59e1cfeb48fa008f8f27f2f892c4f73985de Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
* Change RacyGitTests to create a racy git situation in a stable wayMasaya Suzuki2019-06-191-29/+24
| | | | | | | | | | | By using File#setLastModified, we can create a racy git situation stably. Tested with --runs_per_test=100 Bug: 526111 Change-Id: I60b3632d353e19f335668325aa603640be423f58 Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
* Deprecate Constants.CHARACTER_ENCODING in favor of StandardCharsets.UTF_8David Pursehouse2019-06-1920-53/+61
| | | | | Change-Id: I621ba174235a6fb56236e54d24bce704bb5afb28 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Fix non-deterministic hash of archives created by ArchiveCommandMatthias Sohn2019-06-194-14/+226
| | | | | | | | | | | | | | | | Archives created by the ArchiveCommand didn't produce deterministic archive hashes. For RevCommits RevWalk.parseTree returns the root tree instead of the RevCommit hence retrieving the commit's timestamp didn't work. Instead use RevWalk.parseAny and extract the tree manually. Archive entries store timestamps with 1 second resolution hence we need to wait longer when creating the same archive twice and compare archive hashes. Otherwise hash comparison in tests wouldn't fail without this patch. Bug: 548312 Change-Id: I437d515de51cf68265584d28a8446cebe6341b79 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Update Maven plugins ecj, plexus, error-proneMatthias Sohn2019-06-191-5/+5
| | | | | | | | | | | | update Maven plugins - ecj to 3.17.0 - error_prone_core to 2.3.3 - plexus-compiler-eclipse to 2.8.5 - plexus-compiler-javac to 2.8.5 - plexus-compiler-javac-errorprone to 2.8.5 Change-Id: I51ecb44538915ed84db041510562394bce977a3e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Update Maven plugins and cleanup Maven warningsMatthias Sohn2019-06-184-20/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | update Maven plugins - jacoco-maven-plugin to 0.8.4 - japicmp-maven-plugin to 0.14.1 - maven-compiler-plugin to 3.8.1 - maven-deploy-plugin to 3.0.0-M1 - maven-enforcer-plugin to 3.0.0-M2 - maven-install-plugin to 3.0.0-M1 - maven-jar-plugin to 3.1.2 - maven-javadoc-plugin to 3.1.0 - maven-jxr-plugin to 3.0.0 - maven-pmd-plugin to 3.12.0 - maven-resources-plugin to 3.1.0 - maven-shade-plugin to 3.2.1 - maven-source-plugin to 3.1.0 - maven-surefire-plugin to 3.0.0-M3 - spotbugs-maven-plugin to 3.1.12 - tycho to 1.3.0 - tycho-pack200a-plugin to 1.3.0 - tycho-pack200b-plugin to 1.3.0 Cleanup Maven warnings - pin version of all used Maven plugins - remove deprecated way to declare minimum Maven version Change-Id: If23e2e2bb03e5e1e7b1eb9d4924a8faa0aa3704e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Make inner classes static where possibleDavid Pursehouse2019-06-1712-14/+15
| | | | | | | | | | | | | | As reported by Error Prone: An inner class should be static unless it references members of its enclosing class. An inner class that is made non-static unnecessarily uses more memory and does not make the intent of the class clear. See https://errorprone.info/bugpattern/ClassCanBeStatic Change-Id: Ib99d120532630dba63cf400cc1c61c318286fc41 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com> (cherry picked from commit ee40efcea44bc0c9a28afe29a80c87636947484e)
* Fix API problem filtersMatthias Sohn2019-06-172-2/+2
| | | | Change-Id: I0f7a72934022346c9903d7dc5ec11e959cc8dac3 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 5.1.9-SNAPSHOT buildsMatthias Sohn2019-06-0556-357/+357
| | | | | Change-Id: I60571e4e0bea04bb2c25ef3d0332a9ab6895db06 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v5.1.8.201906050907-rv5.1.8.201906050907-rMatthias Sohn2019-06-0556-59/+59
| | | | | Change-Id: Iae0ffe161df2ca8a800d21688d6b7d7419dfb640 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Test detecting modified packfilesChristian Halstrick2019-06-051-11/+222
| | | | | | | | | | | | | Test that JGit detects that packfiles have changed even if they are repacked multiple times in one tick of the filesystem timer. Test that this detection works also when repacking doesn't change the length or the filekey of the packfile. In this case where a modified file can't be detected by looking at file metadata JGit should still detect too fast modification by racy git checks and trigger rescanning the pack list and consequently rereading of packfile content. Change-Id: I67682cfb807c58afc6de9375224ff7489d6618fb Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Enhance fsTick() to use filesystem timer resolutionChristian Halstrick2019-06-051-8/+16
| | | | | | | | | | RepositoryTestCase.fsTick() was was waiting 64, 128, 256, ... milliseconds until it detected that the filesystem timer has ticked. Make use of the filesystemtimer resolution information in FS to sleep a fraction of the filesystem timer resolution. That raises probability to wake up shortly after the filesystem timer has ticked. Change-Id: Ibcc38576e42ece13b2fd4423a29c459eed167a69
* Add debug trace to measure time needed to open pack indexMatthias Sohn2019-06-041-0/+13
| | | | Change-Id: Ia698cc06aa3fe6cb7903a687db8885f1b83c3bf2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Extend FileSnapshot for packfiles to also use checksum to detect changesMatthias Sohn2019-06-044-22/+312
| | | | | | | | | | | | | | If the attributes of FileSnapshot don't detect modification of a packfile read the packfile's checksum and compare it against the checksum cached in the loaded packfile. Since reading the checksum needs less IO than reloading the complete packfile this may help to reduce the overhead to detect modficiation when a gc completes while ObjectDirectory scans for packfiles in another thread. Bug: 546891 Change-Id: I9811b497eb11b8a85ae689081dc5d949ca8c4be5 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Wait opening new packfile until it can't be racy anymoreMatthias Sohn2019-06-046-6/+227
| | | | | | | | | | | | | | | | | If - pack.waitPreventRacyPack = true (default is false) - packfile size > pack.minSizePreventRacyPack (default is 100 MB) wait after a new packfile was written and before it is opened until it cannot be racy anymore. If a new packfile is accessed while it's still racy at least the pack's index will be reread by ObjectDirectory.scanPacksImpl(). Hence it may save resources to wait one tick of the file system timer to avoid this reloading. On filesystems with a coarse timestamp resolution it may be beneficial to skip this wait for small packfiles. Bug: 546891 Change-Id: I0e8bf3d7677a025edd2e397dd2c9134ba59b1a18 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Avoid null PackConfig in GCMatthias Sohn2019-05-291-6/+7
| | | | | | Initialize it using the repository's config already in the constructor. Change-Id: I4ea620a7db72956e7109f739990f09644640206b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>