Skip to content

Add spooling query heartbeat - #179

Open
Flgado wants to merge 1 commit into
trinodb:masterfrom
Flgado:spooled_heartbeat
Open

Add spooling query heartbeat#179
Flgado wants to merge 1 commit into
trinodb:masterfrom
Flgado:spooled_heartbeat

Conversation

@Flgado

@Flgado Flgado commented Apr 28, 2026

Copy link
Copy Markdown
Member
  • During the spooling protocol, send periodic HTTP HEAD requests to the current nextUri so the coordinator still sees an active client while results are consumed slowly.

  • Configure interval on the connection: DSN heartbeat_interval and Config.HeartbeatInterval (positive time.ParseDuration); if omitted, default 30s when spooling starts.

  • Stop heartbeating on 404/405 (unsupported) or after repeated failures; tie lifecycle to statement Close (doneCh + WaitGroup), with a short per-request timeout for HEAD.

  • Tests: spooled mock server + HEAD counting; DSN validation (invalid / zero / negative / valid); format round-trip; Ping path for bad DSN.

  • Docs: README spooling section + DSN parameter list.

Integration tests

I did not add an integration test in the same style as the Java client change in trinodb/trino#25267.

That PR can drive a small query.client.timeout on a test-only Trino server so slow spooled consumption reliably hits “query abandoned” unless heartbeats run. Here, our integration suite talks to a normal shared Trino (Docker in CI). query.client.timeout is coordinator-wide, not something we can set per connection or per query from the Go client, so we cannot cheaply reproduce the same “tight timeout” scenario without extra Trino config / a dedicated container / a new CI profile. Any idea for this @nineinchnick ?

So this PR validates heartbeats with unit tests (mock server, count HEAD to the current nextUri, DSN parsing, etc.), which still checks the client behavior without requiring a special server setup.

Made-with: Cursor
@cla-bot cla-bot Bot added the cla-signed label Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant