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 ...@@ -19,6 +19,4 @@ classes
# vim # vim
*.swp *.swp
# go.sum vendor/
# Gopkg.lock
# vendor/
...@@ -5,7 +5,9 @@ go: ...@@ -5,7 +5,9 @@ go:
- "1.12" - "1.12"
- "1.13" - "1.13"
env:
- GO111MODULE=on
script: script:
- go fmt ./... && [[ -z `git status -s` ]] - 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 ...@@ -12,6 +12,7 @@ package getty
import ( import (
"bytes" "bytes"
"fmt" "fmt"
"io"
"net" "net"
"runtime" "runtime"
"sync" "sync"
...@@ -524,7 +525,7 @@ func (s *session) handleLoop() { ...@@ -524,7 +525,7 @@ func (s *session) handleLoop() {
grNum := atomic.AddInt32(&(s.grNum), -1) grNum := atomic.AddInt32(&(s.grNum), -1)
s.listener.OnClose(s) 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() s.gc()
}() }()
...@@ -720,6 +721,11 @@ func (s *session) handleTCPPackage() error { ...@@ -720,6 +721,11 @@ func (s *session) handleTCPPackage() error {
if netError, ok = perrors.Cause(err).(net.Error); ok && netError.Timeout() { if netError, ok = perrors.Cause(err).(net.Error); ok && netError.Timeout() {
break break
} }
if perrors.Cause(err) == io.EOF {
err = nil
exit = true
break
}
log.Errorf("%s, [session.conn.read] = error:%+v", s.sessionToken(), err) log.Errorf("%s, [session.conn.read] = error:%+v", s.sessionToken(), err)
exit = true 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