mirror of
https://github.com/apache/maven-mvnd.git
synced 2026-01-13 07:04:14 +08:00
Handle BufferUnderflowException as a possible registry corruption (#614)
This commit is contained in:
@@ -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. " +
|
||||
|
||||
Reference in New Issue
Block a user