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 8, 2024
1 parent a3d8270 commit 315faca
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 315faca

Please sign in to comment.