Skip to content

[Bug]: shutdown timeout on large repos causes gob index corruption #235

@khaney64

Description

@khaney64

Bug Description

When running grepai watch on a large repository and stopping with Ctrl-C (the documented stop method), the shutdown process exceeds an internal timeout, resulting in a partially-written gob index file that cannot be loaded on next startup.

Steps to Reproduce

Steps to reproduce:

Run grepai index on a large repository (openclaw codebase, ~hundreds of files)
Run grepai watch — wait for Watching for changes... (Press Ctrl+C to stop)
Press Ctrl-C to stop
Observe shutdown output shows [STOPPED] - shutdown timeout
Run grepai watch again

Expected Behavior

Watch stops cleanly and the index is intact on next run.

Actual Behavior

[STOPPED] C:\development\ai\openclaw-code\openclaw - shutdown timeout

On next grepai watch:
[ERROR] C:\development\ai\openclaw-code\openclaw - failed to load index: failed to decode index: unexpected EOF
Error: failed to load index: failed to decode index: unexpected EOF

grepai Version

grepai version 0.35.0

Operating System

Windows

Embedding Provider

Ollama (nomic-embed-text)

Relevant Logs

Configuration

Checklist

  • I have searched existing issues to avoid duplicates
  • I am using the latest version of grepai

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions