Skip to content

feat: show waiting-on details for pending resources - #11

Merged
seriousben merged 4 commits into
mainfrom
seriousben/fix-connect-issue
Feb 18, 2026
Merged

seriousben merged 4 commits into
mainfrom
seriousben/fix-connect-issue

Conversation

@seriousben

Copy link
Copy Markdown
Owner

No description provided.

- Rename PendingBlockerInfo to PendingResourceInfo with richer data
- Add WaitingInfo model to track what each resource is waiting on
- Display waiting-on resource names and reasons in the menu
- Track all pending resources, not just those blocking dependents
- Reorder menu sections: failures, updating, waiting
The retry loop would silently freeze when tilt briefly connected then
exited. Two root causes:

1. Cooperative thread pool starvation: refreshDependencyGraph() and
   triggerUpdate() used Task.detached with blocking waitUntilExit()
   calls. When tilt was unstable, these hung indefinitely, starving
   the thread pool and preventing Task.sleep continuations from being
   scheduled. Fix: move to DispatchQueue.global().async.

2. Pipe buffer deadlock: readDataToEndOfFile() was called after
   waitUntilExit(). If process output exceeded 64KB, the pipe buffer
   filled, the process blocked on write, and waitUntilExit() waited
   forever. Fix: read before wait.

Additional improvements:
- Replace readabilityHandler with FileHandle.bytes.lines to fix a
  race where the process could exit before the stream was iterated
- Add terminationHandler safety net to force-close pipes on exit
- Use Task.detached for watch loop to avoid inheriting main actor
- Add explicit Task.sleep error handling instead of silent try?
- Add timestamped logging for all TiltClient diagnostics
- Add stale data clearing with grace period on disconnect
- Log Connected state alongside existing Connecting state
Document the recurring pitfalls found debugging the watch loop:
- Never block Swift's cooperative thread pool
- Read pipe data before waitUntilExit to avoid deadlock
- Never use try? with Task.sleep
@seriousben
seriousben merged commit 56f8d49 into main Feb 18, 2026
1 check passed
@seriousben
seriousben deleted the seriousben/fix-connect-issue branch February 18, 2026 02:11
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.

1 participant