Skip to content

Commit

Permalink
epoll: opt err log for addConn
Browse files Browse the repository at this point in the history
  • Loading branch information
lesismal committed May 22, 2024
1 parent 48e6dfa commit f136b1c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions poller_epoll.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ func (p *poller) addConn(c *Conn) error {
if err != nil {
p.g.connsUnix[fd] = nil
c.closeWithError(err)
logging.Error("[%v] add read event failed: %v", c.fd, err)
}
return err
}
Expand All @@ -112,7 +111,6 @@ func (p *poller) addDialer(c *Conn) error {
if err != nil {
p.g.connsUnix[fd] = nil
c.closeWithError(err)
logging.Error("[%v] add read event failed: %v", c.fd, err)
}
return err
}
Expand Down Expand Up @@ -172,7 +170,16 @@ func (p *poller) acceptorLoop() {
conn.Close()
continue
}
p.g.pollers[c.Hash()%len(p.g.pollers)].addConn(c)
err = p.g.pollers[c.Hash()%len(p.g.pollers)].addConn(c)
if err != nil {
logging.Error("NBIO[%v][%v_%v] addConn [fd: %v] failed: %v",
p.g.Name,
p.pollType,
p.index,
c.fd,
err,
)
}
} else {
var ne net.Error
if ok := errors.As(err, &ne); ok && ne.Timeout() {
Expand Down

0 comments on commit f136b1c

Please sign in to comment.