From a50a8a4f78f34569deec2ec3eb6c42115dd75b6b Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 22 Jan 2025 09:19:01 +0100 Subject: [PATCH] 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 --- src/libs/utils/deviceshell.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/libs/utils/deviceshell.cpp b/src/libs/utils/deviceshell.cpp index 5f12c8ab829..830425c39e5 100644 --- a/src/libs/utils/deviceshell.cpp +++ b/src/libs/utils/deviceshell.cpp @@ -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, {}, {}};