Skip to content

fix: Set request_timeout on cassandra store when it is set in custome… - #383

Merged
omirandadev merged 1 commit into
masterfrom
fix/go-cassandra-request-timeout
Oct 6, 2026
Merged

omirandadev merged 1 commit into
masterfrom
fix/go-cassandra-request-timeout

Conversation

@omirandadev

Copy link
Copy Markdown
Collaborator

What this PR does / why we need it:

The Go Cassandra/ScyllaDB online store only read request_timeout_millis. The Python SDK reads request_timeout (in seconds) from the same feature_store.yaml and rejects unknown keys, so there was no way to set a read timeout for the Go feature server from a shared config. Anyone who set request_timeout got gocql's 11s default with no warning.

Changes:

  • Read request_timeout (seconds, float). request_timeout_millis still wins if it's set to a positive value.
  • Missing, null, zero or negative values fall back to the gocql default, with a warning for zero or negative. Non-numeric values now return a config error instead of panicking.
  • Store the timeout as a time.Duration so values like 0.03 aren't truncated.
  • When a request timeout is set, keep WriteTimeout at the gocql default. Otherwise gocql also uses Timeout as the socket write deadline, and a write that stalls past it closes the connection and fails every in-flight query on it.
  • Log the effective timeout and retry count on startup.

Which issue(s) this PR fixes:

N/A

Checks

  • I've made sure the tests are passing.
  • My commits are signed off (git commit -s)
  • My PR title follows conventional commits format

Testing Strategy

  • Unit tests
  • Integration tests
  • Manual tests
  • Testing is not required for this change

Misc

  • The timeout is per attempt. With SimpleRetryPolicy{NumRetries: 3}, a read that keeps timing out fails after roughly 4x the timeout.
  • This changes behavior for anyone who already sets request_timeout: after upgrading, it applies instead of the 11s default. A whole number meant as milliseconds (30) will mean 30 seconds.
  • gocql also uses Timeout as the read deadline for response bodies, and there's no separate setting for that, so a response that stalls for ~5x the timeout can still drop the connection.
  • New unit tests cover both keys, precedence, null/zero/negative/non-numeric values, rounding, WriteTimeout staying at the default, and loading a real feature_store.yaml through NewRepoConfigFromFile with 0.03 and 30. go test ./go/internal/feast/onlinestore/ -skip Sqlite and go test ./go/internal/feast/registry/ pass (the Sqlite test needs the Python feast CLI on PATH).

@omirandadev
omirandadev merged commit 9e2590f into master Oct 6, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants