Fix workshop download hanging on "Requesting download..." on macOS - #2
Open
clspeter wants to merge 1 commit into
Open
Fix workshop download hanging on "Requesting download..." on macOS#2clspeter wants to merge 1 commit into
clspeter wants to merge 1 commit into
Conversation
steamcmd frequently hangs after a workshop download completes instead of exiting on +quit (thread-race during Steam API teardown on macOS), leaving downloadWorkshopItem() blocked forever on waitUntilExit() and the UI stuck on "Requesting download...". Detect the success line and terminate steamcmd ourselves once the files are on disk, then bound the exit wait with a timeout backstop (mirroring runSteamCmd) so a process that stalls before printing success can't block the download indefinitely. Co-Authored-By: Claude Opus 4.8 <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.
Problem
On macOS,
steamcmdfrequently hangs after a workshop download completes instead of exiting on+quit— a thread-race during Steam API teardown (the sameUnexpected thread race for CIOPollingHelper/work processing queue not emptymessages steamcmd prints on shutdown).Because
downloadWorkshopItem()waits onprocess.waitUntilExit()with no bound, the app stays stuck on "Requesting download..." forever, even though the item is already fully downloaded tosteamapps/workshop/content/431960/<id>/. The download never gets copied into the library and the UI never recovers.Fix
Two changes, both scoped to
downloadWorkshopItem()inSteamCmdService.swift:Downloaded item) and callsprocess.terminate()itself. The files are already on disk at that point, so the existing "copy to library" logic (which keys off file existence, not exit code) proceeds normally.process.waitUntilExit()is wrapped in aDispatchGrouptimeout backstop — mirroring the pattern already used inrunSteamCmd()— so a process that stalls before printing success (e.g. a network hang) can't block the download indefinitely either.Testing
827148653:workshop_log.txtshowedDownload item 827148653 result : OK/Finished Workshop download job : No Error, but the steamcmd process never exited and the UI stayed on "Requesting download...".xcodebuild -scheme "Open Wallpaper Engine" build→ BUILD SUCCEEDED.🤖 Generated with Claude Code