Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Unified Diff: logdog/appengine/coordinator/archivalPublisher.go

Issue 2583033002: LogDog: Re-use Pub/Sub gRPC clients. (Closed)
Patch Set: close under lock Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | logdog/appengine/coordinator/service.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: logdog/appengine/coordinator/archivalPublisher.go
diff --git a/logdog/appengine/coordinator/archivalPublisher.go b/logdog/appengine/coordinator/archivalPublisher.go
index fd17b34a8b37f5ada8b9c3b114186c87c9e0ef34..906bc9544f9bce804e6ef2db7d7018315323b35d 100644
--- a/logdog/appengine/coordinator/archivalPublisher.go
+++ b/logdog/appengine/coordinator/archivalPublisher.go
@@ -17,7 +17,7 @@ import (
// ArchivalPublisher is capable of publishing archival requests.
type ArchivalPublisher interface {
- // Close shutdowns this publisher, releasing all its resources.
+ // Close shutdowns this publisher instance, releasing all its resources.
Close() error
// Publish publishes the supplied ArchiveTask.
@@ -30,6 +30,9 @@ type ArchivalPublisher interface {
type pubsubArchivalPublisher struct {
// client is Pub/Sub client used by the publisher.
+ //
+ // This client is owned by the prodServicesInst that created this instnace,
+ // and should not be closed on shutdown here.
client *gcps.Client
// topic is the authenticated Pub/Sub topic handle to publish to.
@@ -40,9 +43,7 @@ type pubsubArchivalPublisher struct {
publishIndexFunc func() uint64
}
-func (p *pubsubArchivalPublisher) Close() error {
- return p.client.Close()
-}
+func (p *pubsubArchivalPublisher) Close() error { return nil }
func (p *pubsubArchivalPublisher) Publish(c context.Context, t *logdog.ArchiveTask) error {
d, err := proto.Marshal(t)
« no previous file with comments | « no previous file | logdog/appengine/coordinator/service.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698