Skip to content

Commit

Permalink
fix(datconn): don't orphan client goroutine when remote is closed
Browse files Browse the repository at this point in the history
Longhorn 8711

Signed-off-by: Eric Weber <eric.weber@suse.com>
  • Loading branch information
ejweber committed Aug 21, 2024
1 parent 6f050a1 commit 109aaf7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/backend/remote/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ type Remote struct {

func (r *Remote) Close() error {
logrus.Infof("Closing: %s", r.name)

// Close the dataconn client to avoid orphaning goroutines.
if dataconnClient, ok := r.ReaderWriterUnmapperAt.(*dataconn.Client); ok {
dataconnClient.Close()
}

conn, err := grpc.NewClient(r.replicaServiceURL, grpc.WithTransportCredentials(insecure.NewCredentials()),
interceptor.WithIdentityValidationClientInterceptor(r.volumeName, ""))
if err != nil {
Expand Down

0 comments on commit 109aaf7

Please sign in to comment.