Skip to content

feat: Request timeout configuration #54

@Snider

Description

@Snider

Summary

Configurable timeouts for different stages of requests.

Use Case

Some servers are slow, some hang forever. Need fine-grained timeout control.

Timeout Types

Timeout Description
connect TCP connection establishment
tls TLS handshake
headers Time to receive response headers
body Time to download full body
total Overall request timeout

Commands

# Total timeout
borg collect website https://slow-site.com --timeout 60s

# Specific timeouts
borg collect website https://slow-site.com \
  --connect-timeout 10s \
  --header-timeout 30s \
  --body-timeout 120s

# Disable timeout (dangerous)
borg collect website https://example.com --timeout 0

Configuration

timeouts:
  connect: 10s
  tls: 10s
  headers: 30s
  body: 300s      # 5 minutes for large files
  total: 600s     # 10 minutes max

# Per-domain overrides
domains:
  archive.org:
    body: 600s    # Archive.org is slow
  
  github.com:
    total: 60s    # Should be fast

Large File Handling

For large downloads, use:

  • Progress-based timeout (no data in X seconds)
  • Rather than absolute timeout
body_idle_timeout: 30s  # Timeout if no data for 30s

Acceptance Criteria

  • Per-stage timeout configuration
  • Per-domain overrides
  • Idle timeout for large downloads
  • Clear timeout error messages
  • Graceful cleanup on timeout

Metadata

Metadata

Assignees

No one assigned

    Labels

    julesFor Jules AI to work on

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions