Skip to content

fix(shaka-lab-node): Time out the driver update at startup - #94

Merged
joeyparrish merged 1 commit into
shaka-project:mainfrom
joeyparrish:update-timeout
Jul 29, 2026
Merged

fix(shaka-lab-node): Time out the driver update at startup#94
joeyparrish merged 1 commit into
shaka-project:mainfrom
joeyparrish:update-timeout

Conversation

@joeyparrish

Copy link
Copy Markdown
Member

start-nodes.js ran update-drivers with a blocking spawnSync and no timeout. The script talks to package registries, driver CDNs, attached devices, and OS services, and when one of those never answers, the service never finishes starting. It just sits wedged, with nothing past the last line of driver installer output to say why. This was observed on a Windows node, where the update stalled and a stray webdriver-installer process kept the service hostage until it was killed by hand.

Wait for the script asynchronously with a 10 minute ceiling instead. On timeout, kill it and everything below it, then reject so the process exits non-zero and the service manager restarts us.

Killing the tree matters as much as the timeout. On Windows the script runs under a shell, so killing the direct child would orphan npm and the driver installer, recreating the exact stray process seen in the incident; taskkill /T /F covers the tree, as it already does for the node processes. On other platforms the script is now spawned in its own process group so a negative PID reaches the same processes.

start-nodes.js ran update-drivers with a blocking spawnSync and no
timeout.  The script talks to package registries, driver CDNs, attached
devices, and OS services, and when one of those never answers, the
service never finishes starting.  It just sits wedged, with nothing past
the last line of driver installer output to say why.  This was observed
on a Windows node, where the update stalled and a stray
webdriver-installer process kept the service hostage until it was killed
by hand.

Wait for the script asynchronously with a 10 minute ceiling instead.  On
timeout, kill it and everything below it, then reject so the process
exits non-zero and the service manager restarts us.

Killing the tree matters as much as the timeout.  On Windows the script
runs under a shell, so killing the direct child would orphan npm and the
driver installer, recreating the exact stray process seen in the
incident; taskkill /T /F covers the tree, as it already does for the
node processes.  On other platforms the script is now spawned in its own
process group so a negative PID reaches the same processes.

Co-Authored-By: Claude Code (Claude Opus 5) <noreply@anthropic.com>
@joeyparrish
joeyparrish requested a review from a team July 28, 2026 23:09
@google-cla

google-cla Bot commented Jul 28, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@joeyparrish

Copy link
Copy Markdown
Member Author

This should prevent the Windows service from hanging on any misbehaving update tooling in the future. The companion change in shaka-project/webdriver-installer#75 should fix the root cause of the hung update.

@joeyparrish
joeyparrish merged commit 3852c7b into shaka-project:main Jul 29, 2026
6 of 7 checks passed
@joeyparrish
joeyparrish deleted the update-timeout branch July 29, 2026 05:28
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.

2 participants