Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
https://github.com/apache/thrift/blob/master/lib/go/thrift/framed_transport.go#L143
if p.transport.Write fails, p.buf will not be truncated, which leads to thrift client's memory increasing forever.
Is it more reasonable to truncate p.buf when write to transport fails? here are my pull request, https://github.com/apache/thrift/pull/1303
i'm new in github&jira, if more details are needed, please tell me, thx.
func (p *TFramedTransport) Flush() error { size := p.buf.Len() buf := p.buffer[:4] binary.BigEndian.PutUint32(buf, uint32(size)) _, err := p.transport.Write(buf) if err != nil { return NewTTransportExceptionFromError(err) } if size > 0 { if n, err := p.buf.WriteTo(p.transport); err != nil { print("Error while flushing write buffer of size ", size, " to transport, only wrote ", n, " bytes: ", err.Error(), "\n") return NewTTransportExceptionFromError(err) } } err = p.transport.Flush() return NewTTransportExceptionFromError(err) }
Attachments
Issue Links
- links to