Skip to content

fix: flashgrep lifecycle cleanup#615

Merged
GCWing merged 2 commits into
GCWing:mainfrom
wgqqqqq:codex/fix-flashgrep-raii-lifecycle
May 9, 2026
Merged

fix: flashgrep lifecycle cleanup#615
GCWing merged 2 commits into
GCWing:mainfrom
wgqqqqq:codex/fix-flashgrep-raii-lifecycle

Conversation

@wgqqqqq
Copy link
Copy Markdown
Collaborator

@wgqqqqq wgqqqqq commented May 8, 2026

Summary

This change tightens flashgrep lifecycle management so the workspace search daemon is owned and cleaned up through a unified core path instead of relying on desktop-only exit cleanup.

What changed

  • moved flashgrep daemon cleanup responsibility into the core-owned search runtime path
  • added a drop fallback for the async daemon client so leaked ownership still triggers best-effort process tree cleanup
  • switched workspace search global registration from a strong global Arc to a Weak reference so the service can actually drop
  • updated idle repo release scheduling to avoid keeping the search service alive unnecessarily
  • replaced desktop-specific shutdown thread wiring with the shared blocking shutdown entrypoint
  • unified platform process cleanup helpers around process-group or process-tree termination semantics

Why

Users reported that flashgrep could remain alive after BitFun exited. The root issue was that lifecycle ownership was not strict RAII: the search service was globally strongly referenced, and daemon cleanup depended too much on explicit desktop shutdown plumbing.

This refactor makes the ownership model tighter and gives the daemon both an explicit shutdown path and a drop-time fallback.

Impact

  • desktop shutdown now uses the shared core lifecycle entrypoint
  • workspace search resources can be released without being pinned forever by a global strong reference
  • Windows, macOS, and Linux share the same lifecycle contract while still using platform-appropriate process cleanup primitives underneath

Validation

  • cargo check --workspace
  • cargo test --workspace

@wgqqqqq wgqqqqq changed the title [codex] fix flashgrep lifecycle cleanup fix: flashgrep lifecycle cleanup May 8, 2026
@wgqqqqq wgqqqqq marked this pull request as ready for review May 9, 2026 02:19
@GCWing GCWing merged commit 6274204 into GCWing:main May 9, 2026
4 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.

2 participants