From 80f03909aec91afc8bfa505e9ff9a0f9c2455218 Mon Sep 17 00:00:00 2001 From: "vitess-bot[bot]" <108069721+vitess-bot[bot]@users.noreply.github.com> Date: Tue, 27 Feb 2024 07:46:55 -0500 Subject: [PATCH] Cherry-pick aba0d83c8ae23c493fe2af76b39d68e872c3ab86 with conflicts --- go/vt/topo/memorytopo/election.go | 5 +++++ go/vt/topo/memorytopo/memorytopo.go | 4 ++++ go/vt/topo/memorytopo/watch.go | 10 ++++++++++ 3 files changed, 19 insertions(+) diff --git a/go/vt/topo/memorytopo/election.go b/go/vt/topo/memorytopo/election.go index ad173695099..3a00565f7c2 100644 --- a/go/vt/topo/memorytopo/election.go +++ b/go/vt/topo/memorytopo/election.go @@ -26,6 +26,11 @@ import ( // NewLeaderParticipation is part of the topo.Server interface func (c *Conn) NewLeaderParticipation(name, id string) (topo.LeaderParticipation, error) { +<<<<<<< HEAD +======= + c.factory.callstats.Add([]string{"NewLeaderParticipation"}, 1) + +>>>>>>> aba0d83c8a (CI: Address data races on memorytopo Conn.closed (#15365)) if c.closed.Load() { return nil, ErrConnectionClosed } diff --git a/go/vt/topo/memorytopo/memorytopo.go b/go/vt/topo/memorytopo/memorytopo.go index b881be1b785..92c4eeae392 100644 --- a/go/vt/topo/memorytopo/memorytopo.go +++ b/go/vt/topo/memorytopo/memorytopo.go @@ -142,6 +142,10 @@ func (c *Conn) dial(ctx context.Context) error { // Close is part of the topo.Conn interface. func (c *Conn) Close() { +<<<<<<< HEAD +======= + c.factory.callstats.Add([]string{"Close"}, 1) +>>>>>>> aba0d83c8a (CI: Address data races on memorytopo Conn.closed (#15365)) c.closed.Store(true) } diff --git a/go/vt/topo/memorytopo/watch.go b/go/vt/topo/memorytopo/watch.go index 0f245c95b5f..578bff69ce4 100644 --- a/go/vt/topo/memorytopo/watch.go +++ b/go/vt/topo/memorytopo/watch.go @@ -25,6 +25,11 @@ import ( // Watch is part of the topo.Conn interface. func (c *Conn) Watch(ctx context.Context, filePath string) (*topo.WatchData, <-chan *topo.WatchData, error) { +<<<<<<< HEAD +======= + c.factory.callstats.Add([]string{"Watch"}, 1) + +>>>>>>> aba0d83c8a (CI: Address data races on memorytopo Conn.closed (#15365)) if c.closed.Load() { return nil, nil, ErrConnectionClosed } @@ -75,6 +80,11 @@ func (c *Conn) Watch(ctx context.Context, filePath string) (*topo.WatchData, <-c // WatchRecursive is part of the topo.Conn interface. func (c *Conn) WatchRecursive(ctx context.Context, dirpath string) ([]*topo.WatchDataRecursive, <-chan *topo.WatchDataRecursive, error) { +<<<<<<< HEAD +======= + c.factory.callstats.Add([]string{"WatchRecursive"}, 1) + +>>>>>>> aba0d83c8a (CI: Address data races on memorytopo Conn.closed (#15365)) if c.closed.Load() { return nil, nil, ErrConnectionClosed }