Skip to content

Commit

Permalink
VirtualMachine: make receive timeout configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
illwieckz committed Nov 19, 2024
1 parent e124fe0 commit 28a4efe
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/engine/framework/VirtualMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ static Cvar::Cvar<bool> vm_nacl_bootstrap(
"Use NaCl bootstrap helper",
Cvar::INIT, true);

static Cvar::Cvar<int> vm_timeout(
"vm.timeout",
"Receive timeout in seconds",
Cvar::INIT, 2);

namespace VM {

// https://github.com/Unvanquished/Unvanquished/issues/944#issuecomment-744454772
Expand Down Expand Up @@ -502,8 +507,9 @@ void VMBase::Create()

// Only set a receive timeout for non-debug configurations, otherwise it
// would get triggered by breakpoints.
if (type != TYPE_NATIVE_DLL && !params.debug.Get())
rootChannel.SetRecvTimeout(std::chrono::seconds(2));
if (type != TYPE_NATIVE_DLL && !params.debug.Get()) {
rootChannel.SetRecvTimeout(std::chrono::seconds(vm_timeout.Get()));
}

// Read the ABI version detection ABI version from the root socket.
// If this fails, we assume the remote process failed to start
Expand Down

0 comments on commit 28a4efe

Please sign in to comment.