Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2157bff

Browse files
authored
fix: Clean up conn on NewStream error in memDRPC (#6182)
1 parentd355783 commit2157bff

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

‎provisionersdk/transport.go‎

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,18 @@ func (m *memDRPC) NewStream(ctx context.Context, rpc string, enc drpc.Encoding)
110110
}
111111
dConn:=drpcconn.New(conn)
112112
stream,err:=dConn.NewStream(ctx,rpc,enc)
113-
iferr==nil {
114-
gofunc() {
115-
select {
116-
case<-stream.Context().Done():
117-
case<-m.closed:
118-
}
119-
_=dConn.Close()
120-
_=conn.Close()
121-
}()
113+
iferr!=nil {
114+
_=dConn.Close()
115+
_=conn.Close()
116+
returnnil,err
122117
}
123-
returnstream,err
118+
gofunc() {
119+
select {
120+
case<-stream.Context().Done():
121+
case<-m.closed:
122+
}
123+
_=dConn.Close()
124+
_=conn.Close()
125+
}()
126+
returnstream,nil
124127
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp