)]}'
{
  "commit": "e60b9e1879f8774e1afe07be4224605045f49eec",
  "tree": "b56529d6a10505c3b94980b4fd3e7d35e8d9d900",
  "parents": [
    "3b368d5578db13b52b2485b11bf3da1e24ccffd2"
  ],
  "author": {
    "name": "Han-Wen Nienhuys",
    "email": "hanwen@google.com",
    "time": "Wed Jul 31 17:27:47 2019 +0200"
  },
  "committer": {
    "name": "Matthias Sohn",
    "email": "matthias.sohn@sap.com",
    "time": "Wed Aug 07 13:56:08 2019 +0200"
  },
  "message": "FileSnapshot: fix bug with timestamp thresholding\n\nIncrease the safety factor to 2.5x for extra safety if max of measured\ntimestamp resolution and measured minimal racy threshold is \u003c 100ms, use\n1.25 otherwise since for large filesystem resolution values the\ninfluence of finite resolution of the system clock should be negligible.\n\nBefore, not yet using the newly introduced minRacyThreshold measurement,\nthe threshold was 1.1x FS resolution, and we could issue the\nfollowing sequence of events,\n\n  start\n  create-file\n  read-file (currentTime)\n  end\n\nwhich had the following timestamps:\n\n  create-file 1564589081998\n  start 1564589082002\n  read 1564589082003\n  end 1564589082004\n\nIn this case, the difference between create-file and read is 5ms,\nwhich exceeded the 4ms FS resolution, even though the events together\ntook just 2ms of runtime.\n\nReproduce with:\n  bazel test --runs_per_test\u003d100 \\\n    //org.eclipse.jgit.test:org_eclipse_jgit_internal_storage_file_FileSnapshotTest\n\nThe file system timestamp resolution is 4ms in this case.\n\nThis code assumes that the kernel and the JVM use the same clock that\nis synchronized with the file system clock. This seems plausible,\ngiven the resolution of System.currentTimeMillis() and the latency for\na gettimeofday system call (typically ~1us), but it would be good to\njustify this with specifications.\n\nAlso cover a source of flakiness: if the test runs under extreme load,\nthen we could have\n\n  start\n  create-file\n  \u003clong delay\u003e\n  read\n  end\n\nwhich would register as an unmodified file. Avoid this by skipping the\ntest if end-start is too big.\n\n[msohn]:\n- downported from master to stable-5.1\n- skip test if resolution is below 10ms\n- adjust safety factor to 1.25 for resolutions above 100ms\n\nChange-Id: I87d2cf035e01c44b7ba8364c410a860aa8e312ef\nSigned-off-by: Han-Wen Nienhuys \u003chanwen@google.com\u003e\nSigned-off-by: Matthias Sohn \u003cmatthias.sohn@sap.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "40af9e2a00975d1eb659dde1a1602e1499fe3d90",
      "old_mode": 33188,
      "old_path": "org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileSnapshotTest.java",
      "new_id": "6fa35d64b09efe08477c98951d317ae414243d3d",
      "new_mode": 33188,
      "new_path": "org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileSnapshotTest.java"
    },
    {
      "type": "modify",
      "old_id": "77005100efd16f093855b4dbbab0152832d56f53",
      "old_mode": 33188,
      "old_path": "org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileSnapshot.java",
      "new_id": "976f946e5d930aea2954e8aecede302263e0a360",
      "new_mode": 33188,
      "new_path": "org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileSnapshot.java"
    }
  ]
}
