Project
vgrep
Description
The HTTP client in src/server/client.rs uses TcpStream::connect() without setting read or write timeouts. If the server hangs or the network is slow, the client will block indefinitely with no way to cancel except killing the process.
Error Message
No error - client hangs indefinitely (no timeout).
Debug Logs
System Information
- Bounty Version: 0.1.0
- OS: Ubuntu 24.04 LTS
- Rust: 1.75+
Screenshots
No response
Steps to Reproduce
- Start a server that accepts connections but doesn't respond:
nc -l 7777 & # Accept connection but never respond
- Run vgrep in server mode pointing to that port:
vgrep config set mode server
vgrep search "test"
- Observe the client hangs forever waiting for response
- Must Ctrl+C to cancel - no automatic timeout
Expected Behavior
The client should:
- Set a reasonable connect timeout (e.g., 5 seconds)
- Set read/write timeouts (e.g., 30-60 seconds for embedding operations)
- Return a clear timeout error if server doesn't respond
Actual Behavior
- No timeouts are set
- Client blocks indefinitely on:
TcpStream::connect() if host is unreachable
write_all() if network is congested
read_to_string() if server hangs
- User must Ctrl+C or kill the process
Additional Context
This affects all client operations:
search() - Line 70
embed_batch() - Line 118
is_server_running() - Line 161
The issue is particularly problematic when:
- Server crashes mid-request
- Network connectivity issues occur
- Server is overloaded with large embedding batches
- Running in automated scripts/CI where hanging is costly
A configurable timeout (e.g., VGREP_TIMEOUT env var) would be ideal.
Project
vgrep
Description
The HTTP client in
src/server/client.rsusesTcpStream::connect()without setting read or write timeouts. If the server hangs or the network is slow, the client will block indefinitely with no way to cancel except killing the process.Error Message
Debug Logs
System Information
Screenshots
No response
Steps to Reproduce
Expected Behavior
The client should:
Actual Behavior
TcpStream::connect()if host is unreachablewrite_all()if network is congestedread_to_string()if server hangsAdditional Context
This affects all client operations:
search()- Line 70embed_batch()- Line 118is_server_running()- Line 161The issue is particularly problematic when:
A configurable timeout (e.g.,
VGREP_TIMEOUTenv var) would be ideal.