Skip to content

Conversation

juliusv
Copy link
Contributor

@juliusv juliusv commented Jan 24, 2017

This only closes connections to ingesters which are unhealthy or gone, not for leaving ones, so this should be ok.

Fixes #217

@@ -48,6 +48,8 @@ func main() {
if err != nil {
log.Fatalf("Error initializing distributor: %v", err)
}
go dist.Run()
Copy link
Contributor

Choose a reason for hiding this comment

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

I was discussing this with @jml yesterday: in general, I prefer if goroutines are launched inside the constructor, mainly because these components are used in multiple places and its a pain to have to repeat the code everywhere (for instance, you didn't do go run dist.Run() in the ruler or the querieir`). WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah right. Totally missed that these new jobs now also use the distributor internally. Of course. Will fix.

In the past (in Prometheus) we've usually settled on leaving concurrency up to the caller, also in case of these kinds of constructors. The ruler does it like that too, but e.g. the ingester doesn't. I'm cool either way. I'll change the go to be in the constructor for now?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah stick it in the constructor please - and the rule should be changed too (https://github.com/weaveworks/cortex/blob/master/cmd/ruler/main.go#L44) - will file an issue for it.

@juliusv
Copy link
Contributor Author

juliusv commented Jan 24, 2017

Made the changes.

@tomwilkie
Copy link
Contributor

LGTM! It won't auto deploy, I'll do it in a batch tomorrow with my other PRs.

@juliusv juliusv merged commit c47661d into master Jan 24, 2017
@juliusv juliusv deleted the grpc-cleanup branch January 24, 2017 21:29
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.

Leaking gRPC clients
2 participants