Use wall-time for credential helper invalidation#18301
Use wall-time for credential helper invalidation#18301illicitonion wants to merge 1 commit intobazelbuild:masterfrom
Conversation
Previously we were using time intervals which excluded time spent with the system sleeping, which is not appropriate for expiring tokens which expire based on wall-time duration.
|
/cc @tjgq |
|
I'm not sure I understand the problem this PR is trying to solve. You're proposing to switch from I'm also skeptical of the claim that Is this in relation to a particular implementation of the JVM? Do I misunderstand the Java time APIs or what Caffeine is doing? |
|
By "asleep" I mean "if you close your laptop and it suspends". See https://blogs.sap.com/2023/02/10/jfr-timestamps-and-system.nanotime/ for more details - I have observed that if I get a credential helper token while configuring Bazel to use with an 8 hour timeout, close my laptop over night, open it 16 hours later and do a build, Bazel attempts to re-use my stale token. This PR avoids that problem. |
|
Aha, thanks for the clarification! Unfortunately, I think that means neither |
|
I think you should file this as a JDK bug as it is surprising behavior! It sounds like they should have used mach_continuous_time on MacOS. |
|
@bazel-io flag |
|
@bazel-io fork 6.3.0 |
|
Submitted to bugs.java.com as internal id 9075217. |
|
Oddly they removed the link to this issue and the target OS, instead stating that it works on Windows. Responded with a clarification on the OS and system methods. https://bugs.java.com/bugdatabase/view_bug?bug_id=JDK-8307677 |
Previously we were using time intervals which excluded time spent with the system sleeping, which is not appropriate for expiring tokens which expire based on wall-time duration. Closes bazelbuild#18301. PiperOrigin-RevId: 529340767 Change-Id: I15e74e7bc87284f8ba53aedace955b29bd52df8e
Previously we were using time intervals which excluded time spent with the system sleeping, which is not appropriate for expiring tokens which expire based on wall-time duration. Closes #18301. PiperOrigin-RevId: 529340767 Change-Id: I15e74e7bc87284f8ba53aedace955b29bd52df8e Co-authored-by: Daniel Wagner-Hall <dwagnerhall@apple.com> Co-authored-by: keertk <keerthanakumar@google.com>
Previously we were using time intervals which excluded time spent with the system sleeping, which is not appropriate for expiring tokens which expire based on wall-time duration. Closes bazelbuild#18301. PiperOrigin-RevId: 529340767 Change-Id: I15e74e7bc87284f8ba53aedace955b29bd52df8e
Previously we were using time intervals which excluded time spent with the system sleeping, which is not appropriate for expiring tokens which expire based on wall-time duration.