Repository navigation
docs: correct what wait_time actually bounds - #155
Merged
Merged
Conversation
The README described `wait_time` as "Seconds to wait for an operation or
for the instance to become ready". The second half is not true. It is
passed to `wait_for_status`, which covers GCE operations and resource
status polling only. Waiting for the instance to accept connections is
`wait_for_server`, which delegates straight to the transport:
def wait_for_server
instance.transport.connection(state).wait_until_ready
and the transport uses its own `max_wait_until_ready`, not the driver's
`wait_time`.
The gap is easy to hit. Test Kitchen's SSH transport retries
`max_wait_until_ready / 3` times with a 3 second delay, and each attempt
carries its own `connection_timeout` of 15 seconds, so an address that
times out rather than refusing can be waited on for roughly an hour.
Observed with `use_private_ip: true` from outside the network and
`wait_time: 90`: the driver sat in "Waiting for SSH service on
10.128.0.28:22" for over fourteen minutes on a running, billing instance
before it was stopped by hand.
Describe `wait_time` as what it is, and point at the transport setting
that governs readiness, since that is the one that matters when an
instance is unreachable rather than slow - `use_private_ip` from off
network, or WinRM with no firewall rule for 5985.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fix the
wait_timerow in the README's Timing table, and document the transport setting that actually governs how long the driver waits for an instance to become reachable.Why
The README said:
The second half is not true.
wait_timeis passed towait_for_status, which covers GCE operations and resource status polling. Waiting for the instance to become reachable iswait_for_server, which hands straight off to the transport:and the transport applies its own
max_wait_until_ready, which the driver does not set and cannot see.Why it matters
Test Kitchen's SSH transport retries
max_wait_until_ready / 3times with a 3 second delay, and each attempt carries its ownconnection_timeoutof 15 seconds. For an address that times out rather than refusing, that is roughly an hour of waiting — on a running, billing instance.Observed with
use_private_ip: truefrom outside the network andwait_time: 90explicitly set:The two configurations where this bites are the two where the transport can never connect:
use_private_ipfrom off-network, and WinRM without a VPC firewall rule for 5985 (see #154). In both cases the user has setwait_timeexpecting it to cap the wait, and it does nothing.Alternative considered
The driver could wrap
wait_for_serverinTimeout.timeout(wait_time)so the documented behaviour becomes the real behaviour. That is arguably the better fix — it would makewait_timea genuine cost ceiling — but it changes runtime behaviour for anyone currently relying on a transport timeout longer than theirwait_time, so I have kept this PR to documentation. Happy to write that version instead if you would prefer it.🤖 Generated with Claude Code