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

Reuse client for heartbeat. #1946

Merged
merged 2 commits into from
Oct 29, 2018
Merged

Reuse client for heartbeat. #1946

merged 2 commits into from
Oct 29, 2018

Conversation

joshblakeley
Copy link
Member

@joshblakeley joshblakeley commented Oct 26, 2018

Fixes #1951
This prevents the issue with spawning a new open socket for each gateway to dashboard heartbeat that is observed in TLS connections when the default transport is overidden.

From Go client.go:

// The Client's Transport typically has internal state (cached TCP
// connections), so Clients should be reused instead of created as
// needed. Clients are safe for concurrent use by multiple goroutines.

Since we are doing the same operation constantly it makes more sense to create a single client and reuse the connection for the dashboard heartbeat.

@joshblakeley joshblakeley changed the title Reuse a global client for heartbeat. Reuse client for heartbeat. Oct 29, 2018
@asoorm
Copy link
Member

asoorm commented Oct 29, 2018

I think that the fix is fine, but given that it is exactly same as my PR #1952 - better for @buger @dencoded @matiasinsaurralde to review

@buger
Copy link
Member

buger commented Oct 29, 2018

Looks good!

@buger buger merged commit 8ea45c7 into master Oct 29, 2018
buger pushed a commit that referenced this pull request Nov 7, 2018
Fixes #1951
This prevents the issue with spawning a new open socket for each gateway to dashboard heartbeat that is observed in TLS connections when the default transport is overidden.

From Go client.go:

```
// The Client's Transport typically has internal state (cached TCP
// connections), so Clients should be reused instead of created as
// needed. Clients are safe for concurrent use by multiple goroutines.
```

Since we are doing the same operation constantly it makes more sense to create a single client and reuse the connection for the dashboard heartbeat.
buger pushed a commit that referenced this pull request Nov 7, 2018
Fixes #1951
This prevents the issue with spawning a new open socket for each gateway to dashboard heartbeat that is observed in TLS connections when the default transport is overidden.

From Go client.go:

```
// The Client's Transport typically has internal state (cached TCP
// connections), so Clients should be reused instead of created as
// needed. Clients are safe for concurrent use by multiple goroutines.
```

Since we are doing the same operation constantly it makes more sense to create a single client and reuse the connection for the dashboard heartbeat.
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.

None yet

3 participants