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 <[email protected]>
  • Loading branch information
ejweber committed Aug 26, 2024
1 parent fd3a0c4 commit efd3245
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 @@ -47,6 +47,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()),
ptypes.WithIdentityValidationClientInterceptor(r.volumeName, ""))
if err != nil {
Expand Down

0 comments on commit efd3245

Please sign in to comment.