Try find pid for 'qrserver' if 'container' fails
@@ -194,13 +194,28 @@ public class VespaServiceDumperImpl implements VespaServiceDumper {
@Override
public int servicePid() {
if (pid == -1) {
- ContainerPath findPidBinary = nodeAgentCtx.paths().underVespaHome("libexec/vespa/find-pid");
- CommandResult findPidResult = executeCommandInNode(List.of(findPidBinary.pathInContainer(), serviceId()), true);
- this.pid = Integer.parseInt(findPidResult.getOutput());
+ try {
+ pid = findServicePid(serviceId());
+ } catch (RuntimeException e1) {
+ try {
+ // Workaround for Vespa 7 container clusters having service name 'qrserver'
+ if (serviceId().equals("container")) pid = findServicePid("qrserver");
+ else throw e1;
+ } catch (RuntimeException e2) {
+ e1.addSuppressed(e2);
+ throw e1;
+ }
+ }
}
return pid;
}
+ private int findServicePid(String serviceId) {
+ ContainerPath findPidBinary = nodeAgentCtx.paths().underVespaHome("libexec/vespa/find-pid");
+ CommandResult findPidResult = executeCommandInNode(List.of(findPidBinary.pathInContainer(), serviceId), true);
+ return Integer.parseInt(findPidResult.getOutput());
+ }
+
@Override
public CommandResult executeCommandInNode(List<String> command, boolean logOutput) {
CommandResult result = container.executeCommandInContainer(nodeAgentCtx, nodeAgentCtx.users().vespa(), command.toArray(new String[0]));
