Skip to content

Allow overriding UVM start timeout. - #2501

Merged
Amit Barve (ambarve) merged 1 commit into
mainfrom
gcs_timeout_override
Aug 25, 2025
Merged

Allow overriding UVM start timeout.#2501
Amit Barve (ambarve) merged 1 commit into
mainfrom
gcs_timeout_override

Conversation

@ambarve

Copy link
Copy Markdown
Contributor

Currently the uvm.Start() method hardcodes 2 minute timeout value in the context that gets used when making hvsocket connections to the UVM (for entropy, output handling & GCS) . This timeout is good enough for general scenario but is very restrictive when debugging uvm boot issues. This change allows overriding the default timeout via environment variables.

Another option that was considered, was to use the deadline/timeout passed in the context instead of hardcoding it. However, there is code in the Start method that explicitly assumes that the parent context won't have a timeout(we could probably get around that problem by creating a new context without a deadline). Another problem is that there are lot of existing callers of the Start method who may or may not include a proper timeout/deadline in the context. If we suddenly start using that value, they might start seeing unexpected timeouts
(for smaller context deadlines) or they may start noticing uvm start hanging (for longer deadlines).

@ambarve
Amit Barve (ambarve) requested a review from a team as a code owner August 15, 2025 16:13
ExternalCommandToStart = durationFromEnvironment("HCSSHIM_TIMEOUT_EXTERNALCOMMANDSTART", ExternalCommandToStart)
ExternalCommandToComplete = durationFromEnvironment("HCSSHIM_TIMEOUT_EXTERNALCOMMANDCOMPLETE", ExternalCommandToComplete)
TestDRetryLoop = durationFromEnvironment("HCSSHIM_TIMEOUT_TESTDRETRYLOOP", TestDRetryLoop)
GCSConnectionTimeout = durationFromEnvironment("HCSSHIM_TIMEOUT_GCSCONNECTION", GCSConnectionTimeout)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

NIT, from Env doesnt do a parse to include things like 10s vs 10m. So is the env var a raw value here? What is the unit?

@ambarve Amit Barve (ambarve) Aug 21, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, the value should be a string representing the timeout in seconds. I kept it like this to maintain the same format that other variables have. But I can update the variable name to something like HCSSHIM_GCSCONNECTION_TIMEOUT_SECONDS?

Currently the uvm.Start() method hardcodes 2 minute timeout value in the context that gets
used when making hvsocket connections to the UVM (for entropy, output handling & GCS)
. This timeout is good enough for general scenario but is very restrictive when debugging
uvm boot issues. This change allows overriding the default timeout via environment
variables.

Another option that was considered, was to use the deadline/timeout passed in the context
instead of hardcoding it. However, there is code in the Start method that explicitly
assumes that the parent context won't have a timeout(we could probably get around that
problem by creating a new context without a deadline). Another problem is that there are
lot of existing callers of the Start method who may or may not include a proper
timeout/deadline in the context.  If we suddenly start using that value, they might start
seeing unexpected timeouts
(for smaller context deadlines) or they may start noticing uvm start hanging (for longer
deadlines).

Signed-off-by: Amit Barve <ambarve@microsoft.com>
@ambarve
Amit Barve (ambarve) merged commit 15787c0 into main Aug 25, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants