Remote agent timeout machanism
When the frontend IDE disconnects from a remote agent, the agent continues running for a configurable timeout period and automatically shuts down if no new connections are established. This conserves resources on the remote machine.
Configuration
The timeout period is configured in the internal section of the .settings.json file using the agent_idle_timeout_ms field.
The default timeout is 5 minutes (300,000 ms).
Check the following example for syntax:
The following modes can be configured:
value > 0
The agent exits after N ms when no IDEs are connected.
-1 / INFINITE
The agent never exits due to inactivity.
value = 0
The agent exits as soon as the last IDE disconnects.
The exit code for an idle shutdown is 83 (IDLE_EXIT).
Use cases
Default behavior
When there is no user configuration, the following steps occur:
IDE disconnects from the remote agent.
The agent waits for 5 minutes.
If there is no reconnection, the agent exists with code
83.
Reconnection before timeout expires
When the IDE reconnects to the remote agent before the timeout expires, the following steps occur:
The IDE disconnects from the remote agent.
The timeout countdown starts.
The IDE reconnects before the timeout expires.
The timeout is canceled, and the agent continues running.
The timeout is increased
When a user increases the timeout, for example, 30 minutes, the following steps occur:
Set
"agent_idle_timeout_ms": 1800000(30 min).The agent waits for 30 minutes after the last IDE disconnects before exiting.
The idle timeout is disabled
When a user disables the idle timeout, the following steps occur:
Set
"agent_idle_timeout_ms": -1.The agent never exits due to idle. It runs until it is manually stopped or the machine restarts.
The agent exits immediately
When a user sets the idle timeout to 0, the following steps occur:
Set
"agent_idle_timeout_ms": 0.The agent exits immediately after the last IDE disconnects.
Multiple IDE connections
When multiple IDEs are connected simultaneously, the following steps occur:
For example, two IDEs connected and one disconnects.
The timeout does not start while the active connection exists.
The second IDE disconnects.
The timeout starts based on the configuration.
Identify an idle shutdown
When there is an idle shutdown, use the following steps to identify it:
Exit code
83in the logs or process status indicates an idle exit (as opposed to a crash or a manual stop).