Skip to content
Snippets Groups Projects
Commit 7c65a929 authored by cvictory's avatar cvictory
Browse files

add some log

parent 1198c440
No related branches found
No related tags found
No related merge requests found
......@@ -182,6 +182,7 @@ func (c *Client) Request(request *remoting.Request, timeout time.Duration, respo
)
if totalLen, sendLen, err = c.transfer(session, request, timeout); err != nil {
if sendLen != 0 && totalLen != sendLen {
logger.Warnf("start to close the session at request because %d of %d bytes data is sent success. err:%+v", sendLen, totalLen, err)
go c.Close()
}
return perrors.WithStack(err)
......
......@@ -357,6 +357,7 @@ func (h *RpcServerHandler) OnCron(session getty.Session) {
func reply(session getty.Session, resp *remoting.Response) {
if totalLen, sendLen, err := session.WritePkg(resp, WritePkg_Timeout); err != nil {
if sendLen != 0 && totalLen != sendLen {
logger.Warnf("start to close the session at replying because %d of %d bytes data is sent success. err:%+v", sendLen, totalLen, err)
go session.Close()
}
logger.Errorf("WritePkg error: %#v, %#v", perrors.WithStack(err), resp)
......@@ -371,6 +372,7 @@ func heartbeat(session getty.Session, timeout time.Duration, callBack func(err e
remoting.AddPendingResponse(resp)
totalLen, sendLen, err := session.WritePkg(req, 3*time.Second)
if sendLen != 0 && totalLen != sendLen {
logger.Warnf("start to close the session at heartbeat because %d of %d bytes data is sent success. err:%+v", sendLen, totalLen, err)
go session.Close()
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment