This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
The following commit(s) were added to refs/heads/master by this push:
new 4cea5d3 Handle BufferUnderflowException as a possible registry
corruption (#614)
4cea5d3 is described below
commit 4cea5d30785dbac160b1e140f612e8b99d8dbd04
Author: Guillaume Nodet <[email protected]>
AuthorDate: Mon Apr 11 13:18:42 2022 +0200
Handle BufferUnderflowException as a possible registry corruption (#614)
---
common/src/main/java/org/mvndaemon/mvnd/common/DaemonRegistry.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/DaemonRegistry.java
b/common/src/main/java/org/mvndaemon/mvnd/common/DaemonRegistry.java
index 5d3d7a8..1e7abc8 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/DaemonRegistry.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/DaemonRegistry.java
@@ -18,6 +18,7 @@ package org.mvndaemon.mvnd.common;
import java.io.IOException;
import java.lang.management.ManagementFactory;
+import java.nio.BufferUnderflowException;
import java.nio.ByteBuffer;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
@@ -246,7 +247,7 @@ public class DaemonRegistry implements AutoCloseable {
return;
} catch (IOException e) {
throw new RuntimeException("Could not lock offset 0 of " +
registryFile);
- } catch (IllegalStateException |
ArrayIndexOutOfBoundsException e) {
+ } catch (IllegalStateException |
ArrayIndexOutOfBoundsException | BufferUnderflowException e) {
String absPath =
registryFile.toAbsolutePath().normalize().toString();
LOGGER.warn("Invalid daemon registry info, " +
"trying to recover from this issue. " +