Skip to content

[BUG] Health check does not verify server response #19

@olddev94

Description

@olddev94

Project

vgrep

Description

The health() function in src/server/client.rs line 158-178 only checks if it can write to the TCP socket, but never reads the HTTP response. This means a hung server (process running but not responding) would still be reported as "healthy".

Error Message

No error - false positive health status in edge cases.

Debug Logs

System Information

- Bounty Version: 0.1.0
- OS: Ubuntu 24.04 LTS
- Rust: 1.75+

Screenshots

No response

Steps to Reproduce

  1. Start vgrep server: vgrep serve
  2. Cause the server to hang (e.g., block the async runtime)
  3. Run: vgrep status
  4. Observe that health check returns true even though server is unresponsive

Expected Behavior

Health check should verify the complete round-trip:

  1. Send GET /health request
  2. Read the HTTP response
  3. Verify response is received (confirms server is processing)

Actual Behavior

Health check only verifies:

  1. TCP connection can be established
  2. Request bytes can be written to socket

The write succeeds even if the server is hung because bytes go to OS kernel buffers.

Additional Context

The server's /health endpoint itself is simplistic - it always returns {"status": "ok"} without checking if the model is loaded or DB is accessible. A more comprehensive fix would include server-side health validation as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingvalidValid issuevgrep

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions