rpc: Fix mem leak again #327
No reviewers
TrueCloudLab/storage-services-committers
TrueCloudLab/storage-services-developers
Labels
No labels
P0
P1
P2
P3
good first issue
pool
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-sdk-go#327
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "dstepanov-yadro/frostfs-sdk-go:fix/mem_leak_step2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
TBD
@ -36,1 +38,4 @@
func (w *streamWrapper) closeSend() error {
var err error
w.closeSendOnce.Do(
Why do we need once here?
Checked: grpc package already has call more than once protection, so dropped.
@ -37,2 +49,3 @@
func (w *streamWrapper) Close() error {
return w.withTimeout(w.ClientStream.CloseSend)
err := w.closeSend()
w.cancel()
I think we should call cancel explicitly in the
clientStreamWriterCloser.Close()
-- this is why using concrete type helps.But this cancel is still needed -- we can
Close()
on error outside this package7f7539c895
to3ed8039f60
New commits pushed, approval review dismissed automatically according to repository settings
Perfect
@ -46,2 +49,3 @@
func (c *clientStreamWriterCloser) Close() error {
err := c.MessageReadWriter.Close()
err := c.sw.closeSend()
if err != nil
, we probably should callcancel
too.fixed
@ -53,0 +57,4 @@
return err
}
return c.sw.Close()
We call
Close()
which callscloseSend()
+cancel()
.Why not just call
cancel()
?ok, done
The commit message is exquisite! (no).
3ed8039f60
to3978bac499
New commits pushed, approval review dismissed automatically according to repository settings
New commits pushed, approval review dismissed automatically according to repository settings
3978bac499
toa114637e54
a114637e54
to12f64696df
rpc: Fix mem leak againto WIP: rpc: Fix mem leak again12f64696df
to593dd77d84
WIP: rpc: Fix mem leak againto rpc: Fix mem leak again