Unverified Commit 193d5d02 authored by 望哥's avatar 望哥 Committed by GitHub

Merge pull request #30 from dubbo-x/issue29

Fix issue29: skip the log output of EOF error
parents c34c7a71 085aa677
......@@ -19,6 +19,4 @@ classes
# vim
*.swp
# go.sum
# Gopkg.lock
# vendor/
vendor/
......@@ -5,7 +5,9 @@ go:
- "1.12"
- "1.13"
env:
- GO111MODULE=on
script:
- go fmt ./... && [[ -z `git status -s` ]]
- GO111MODULE=on && go mod vendor && go test ./... -bench . -race -v
- go mod vendor && go test ./... -bench . -race -v
......@@ -12,6 +12,7 @@ package getty
import (
"bytes"
"fmt"
"io"
"net"
"runtime"
"sync"
......@@ -524,7 +525,7 @@ func (s *session) handleLoop() {
grNum := atomic.AddInt32(&(s.grNum), -1)
s.listener.OnClose(s)
log.Info("%s, [session.handleLoop] goroutine exit now, left gr num %d", s.Stat(), grNum)
log.Infof("%s, [session.handleLoop] goroutine exit now, left gr num %d", s.Stat(), grNum)
s.gc()
}()
......@@ -720,6 +721,11 @@ func (s *session) handleTCPPackage() error {
if netError, ok = perrors.Cause(err).(net.Error); ok && netError.Timeout() {
break
}
if perrors.Cause(err) == io.EOF {
err = nil
exit = true
break
}
log.Errorf("%s, [session.conn.read] = error:%+v", s.sessionToken(), err)
exit = true
}
......
Markdown is supported
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