mirror of
https://github.com/apache/maven-mvnd.git
synced 2025-10-18 16:40:30 +00:00
Add a a few debug entries to help diagnosing test failures
This commit is contained in:
@@ -222,6 +222,7 @@ public class DaemonConnector {
|
||||
|
||||
private DaemonClientConnection connectToIdleDaemon(Collection<DaemonInfo> idleDaemons, DaemonCompatibilitySpec constraint) {
|
||||
final List<DaemonInfo> compatibleIdleDaemons = getCompatibleDaemons(idleDaemons, constraint);
|
||||
LOGGER.debug("Found {} idle daemons, {} compatibles", idleDaemons.size(), compatibleIdleDaemons.size());
|
||||
return findConnection(compatibleIdleDaemons);
|
||||
}
|
||||
|
||||
@@ -232,6 +233,8 @@ public class DaemonConnector {
|
||||
.collect(Collectors.groupingBy(di -> di.getState() == Canceled));
|
||||
final Collection<DaemonInfo> compatibleCanceledDaemons = getCompatibleDaemons(
|
||||
canceledBusy.getOrDefault(true, Collections.emptyList()), constraint);
|
||||
LOGGER.debug("Found {} busy daemons, {} cancelled, {} compatibles", busyDaemons.size(), canceledBusy.size(),
|
||||
compatibleCanceledDaemons.size());
|
||||
if (!compatibleCanceledDaemons.isEmpty()) {
|
||||
LOGGER.debug("Waiting for daemons with canceled builds to become available");
|
||||
long start = System.currentTimeMillis();
|
||||
|
@@ -75,7 +75,7 @@ public class DaemonConnection implements AutoCloseable {
|
||||
return Message.read(input);
|
||||
} catch (EOFException e) {
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
LOGGER.debug("Discarding EOFException: {}", e.toString());
|
||||
LOGGER.debug("Discarding EOFException: {}", e.toString(), e);
|
||||
}
|
||||
return null;
|
||||
} catch (IOException e) {
|
||||
|
@@ -29,7 +29,7 @@ import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public abstract class Message {
|
||||
public static final int BUILD_REQUEST = 0;
|
||||
public static final int BUILD_REQUEST = 23;
|
||||
public static final int BUILD_STARTED = 1;
|
||||
public static final int BUILD_FINISHED = 2;
|
||||
/** A {@link StringMessage} bearing the {@code artifactId} of the project whose build just started */
|
||||
@@ -67,7 +67,7 @@ public abstract class Message {
|
||||
|
||||
public static Message read(DataInputStream input) throws IOException {
|
||||
int type = input.read();
|
||||
if (type == -1) {
|
||||
if (type < 0) {
|
||||
return null;
|
||||
}
|
||||
switch (type) {
|
||||
@@ -319,7 +319,8 @@ public abstract class Message {
|
||||
final int exitCode;
|
||||
|
||||
public static Message read(DataInputStream input) throws IOException {
|
||||
return new BuildFinished(input.readInt());
|
||||
int exitCode = input.readInt();
|
||||
return new BuildFinished(exitCode);
|
||||
}
|
||||
|
||||
public BuildFinished(int exitCode) {
|
||||
@@ -329,7 +330,7 @@ public abstract class Message {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BuildRequest{exitCode=" + exitCode + '}';
|
||||
return "BuildFinished{exitCode=" + exitCode + '}';
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user