Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a default connect timeout for watch in CRDB driver #2041

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

josephschorr
Copy link
Member

This ensures that if the new connection used for watch hangs, it will timeout

@josephschorr josephschorr requested a review from a team as a code owner August 26, 2024 19:52
@github-actions github-actions bot added the area/datastore Affects the storage system label Aug 26, 2024
tstirrat15
tstirrat15 previously approved these changes Aug 26, 2024
Copy link
Contributor

@tstirrat15 tstirrat15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@josephschorr josephschorr added this pull request to the merge queue Aug 26, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 26, 2024
@josephschorr josephschorr added this pull request to the merge queue Aug 26, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 26, 2024
@josephschorr josephschorr added this pull request to the merge queue Aug 26, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Aug 26, 2024
@josephschorr josephschorr added this pull request to the merge queue Aug 26, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Aug 27, 2024
@josephschorr josephschorr added this pull request to the merge queue Aug 27, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 27, 2024
@josephschorr josephschorr added this pull request to the merge queue Aug 27, 2024
@josephschorr josephschorr removed this pull request from the merge queue due to a manual request Aug 27, 2024
@josephschorr josephschorr added this pull request to the merge queue Aug 27, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Aug 27, 2024
@@ -24,6 +24,7 @@ import (
const (
queryChangefeed = "EXPERIMENTAL CHANGEFEED FOR %s WITH updated, cursor = '%s', resolved = '%s', min_checkpoint_frequency = '0';"
queryChangefeedPreV22 = "EXPERIMENTAL CHANGEFEED FOR %s WITH updated, cursor = '%s', resolved = '%s';"
watchConnectTimeout = 1 * time.Second
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest making this more conservative, and tunable. The code moves from no timeout at all to 1 second, and that could backfire in situations where a CRDB cluster is at capacity

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's actually kind of the point - it would fail fast and then they'd retry. It only applies on the initial connect

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made configurable

This ensures that if the new connection used for watch hangs, it will timeout
@josephschorr josephschorr added this pull request to the merge queue Aug 27, 2024
Merged via the queue into authzed:main with commit a137834 Aug 27, 2024
22 checks passed
@josephschorr josephschorr deleted the crdb-watch-timeout branch August 27, 2024 14:54
@github-actions github-actions bot locked and limited conversation to collaborators Aug 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/CLI Affects the command line area/datastore Affects the storage system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants