RemoteLinux: Fix timeouts when deploying files

The default timeout for runBlocking is 10 seconds, which means that
whenever deploying a file e.g. over a network connection takes longer,
deployment fails. Just set a really large timeout for now, under the
assumption that this code path (passing a large amount of data to a
process) is only used for deployment.

Change-Id: Id5b4902ca97c32f4f024c624e02c0eb341aa7e59
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
Eike Ziller
2025-01-22 09:19:01 +01:00
parent 6afdb96832
commit a50a8a4f78

View File

@@ -88,13 +88,12 @@ RunResult DeviceShell::run(const CommandLine &cmd, const QByteArray &stdInData)
qCDebug(deviceShellLog) << "Running fallback:" << fallbackCmd;
proc.setCommand(fallbackCmd);
proc.setWriteData(stdInData);
proc.runBlocking();
return RunResult{
proc.exitCode(),
proc.rawStdOut(),
proc.rawStdErr()
};
// Practically unlimited timeout since we are most probably running dd for copying
// data to a device here (=deployment), so a) we have no idea how long that might take
// for large files, and b) the user can cancel this manually.
proc.runBlocking(/*timout=*/1h);
// TODO This misses interesting data like proc.errorMessage() and/or proc.exitMessage()
return RunResult{proc.exitCode(), proc.rawStdOut(), proc.rawStdErr()};
}
const RunResult errorResult{-1, {}, {}};