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