Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions agent/src/main/java/com/cloud/agent/Agent.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
import com.cloud.utils.nio.NioClient;
import com.cloud.utils.nio.NioConnection;
import com.cloud.utils.nio.Task;
import com.cloud.utils.script.OutputInterpreter;
import com.cloud.utils.script.Script;

/**
Expand Down Expand Up @@ -598,9 +597,9 @@ protected void setupStartupCommand(final StartupCommand startup) {
}

protected String getAgentArch() {
final Script command = new Script("/usr/bin/arch", 500, logger);
final OutputInterpreter.OneLineParser parser = new OutputInterpreter.OneLineParser();
return command.execute(parser);
String arch = Script.runSimpleBashScript(Script.getExecutableAbsolutePath("arch"), 2000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

original PR had timeout as 1000 (base on my tests with OL8 x86_64 #11251 (comment)), this has 2000. Is there a new finding? Would it make sense to make this configurable then?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rohityadavcloud
would it be better same as #11254 ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've explained my thinking but feel free to revert otherwise @weizhouapache @shwstppr

logger.debug("Arch for agent: {} found: {}", _name, arch);
return arch;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class KVMHostInfo {
private long reservedMemory;
private long overCommitMemory;
private List<String> capabilities = new ArrayList<>();
private static String cpuArchCommand = "/usr/bin/arch";
private static String cpuArchRetrieveExecutable = "arch";
private static List<String> cpuInfoFreqFileNames = List.of("/sys/devices/system/cpu/cpu0/cpufreq/base_frequency","/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq");

public KVMHostInfo(long reservedMemory, long overCommitMemory, long manualSpeed, int reservedCpus) {
Expand Down Expand Up @@ -248,6 +248,6 @@ private void getHostInfoFromLibvirt() {

private String getCPUArchFromCommand() {
LOGGER.info("Fetching host CPU arch");
return Script.runSimpleBashScript(cpuArchCommand);
return Script.runSimpleBashScript(Script.getExecutableAbsolutePath(cpuArchRetrieveExecutable));
}
}
Loading