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

[HOTFIX] Add timeouts to telemetry streams and close/reset streams from write side #7979

Merged
merged 4 commits into from
Feb 25, 2021

Conversation

nholland94
Copy link
Member

No description provided.

@nholland94 nholland94 added the ci-build-me Add this label to trigger a circle+buildkite build for this branch label Feb 19, 2021
@nholland94 nholland94 requested a review from a team as a code owner February 19, 2021 02:25
@nholland94 nholland94 changed the base branch from develop to compatible February 19, 2021 02:25

<-time.After(400 * time.Millisecond)

err = s.Reset()
Copy link
Member

Choose a reason for hiding this comment

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

what does reset do?

Copy link
Member Author

Choose a reason for hiding this comment

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

From my understanding of the documentation, reset tells the other side of the stream to hangup and go away. Closing a stream closes our side of the stream, but the connection doesn't get GC'd until the other side closes as well. A reset forcibly tells the other side to close and directly drops the connection.

@@ -1225,6 +1225,8 @@ type getPeerTelemetryDataMsg struct {
}

func (m *getPeerTelemetryDataMsg) run(app *app) (interface{}, error) {
ctx, _ := context.WithTimeout(app.Ctx, 400*time.Millisecond)
Copy link
Member

Choose a reason for hiding this comment

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

Probably this is long enough but just noting on other streams the timeout is 30 seconds (maybe it should be lower like this on those too though).

Copy link
Member Author

Choose a reason for hiding this comment

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

I can definitely bump this if we don't think 400ms is enough. I was figuring that we expect these to respond quickly and we don't want to keep these connections open as long.

Copy link
Member

Choose a reason for hiding this comment

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

I think it's fine

@imeckler
Copy link
Member

!approved-for-mainnet

@nholland94 nholland94 changed the base branch from compatible to master February 19, 2021 19:10
@nholland94 nholland94 changed the title Add timeouts to telemetry streams and close/reset streams from write side [HOTFIX] Add timeouts to telemetry streams and close/reset streams from write side Feb 19, 2021
@nholland94 nholland94 requested a review from a team as a code owner February 25, 2021 20:57
@lk86 lk86 merged commit 8dfa483 into master Feb 25, 2021
@lk86 lk86 deleted the fix/telemetry-streams branch February 25, 2021 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-build-me Add this label to trigger a circle+buildkite build for this branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants