From d4d6c2b5af9b984ae824fb0073e1b368b39b1aa4 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Fri, 8 Sep 2023 02:14:20 +0200 Subject: Add ShutdownHook to cleanup FileLocks on graceful JVM shutdown This should avoid stale lock files if the JVM is terminated gracefully. Implement a ShutdownHook which can register/unregister listeners which need to do some cleanup during graceful JVM shutdown. This hook is registered as a Java shutdown hook and when the JVM shuts down calls #onShutdown of registered listeners using a parallel stream to let them run concurrently. See https://docs.oracle.com/javase/8/docs/technotes/guides/lang/hook-design.html Bug: 582379 Change-Id: I1621dc5f7d9a8c832b6d1b74cbc47578b1c2f0b8 --- .../resources/org/eclipse/jgit/internal/JGitText.properties | 3 +++ 1 file changed, 3 insertions(+) (limited to 'org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties') diff --git a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties index 80a65b2263..141ea8e201 100644 --- a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties +++ b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties @@ -707,6 +707,9 @@ shortCompressedStreamAt=Short compressed stream at {0} shortReadOfBlock=Short read of block. shortReadOfOptionalDIRCExtensionExpectedAnotherBytes=Short read of optional DIRC extension {0}; expected another {1} bytes within the section. shortSkipOfBlock=Short skip of block. +shutdownCleanup=Cleanup {} during JVM shutdown +shutdownCleanupFailed=Cleanup during JVM shutdown failed +shutdownCleanupListenerFailed=Cleanup of {0} during JVM shutdown failed signatureVerificationError=Signature verification failed signatureVerificationUnavailable=No signature verifier registered signedTagMessageNoLf=A non-empty message of a signed tag must end in LF. -- cgit v1.2.3