Skip to content

Commit

Permalink
Some details after elastic#8278 (elastic#8295)
Browse files Browse the repository at this point in the history
(cherry picked from commit ff566e7)
  • Loading branch information
jsoriano committed Sep 13, 2018
1 parent 872989f commit 4c5a9b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ https://github.com/elastic/beats/compare/v6.4.0...6.x[Check the HEAD diff]
- Add fields for memory fragmentation, memory allocator stats, copy on write, master-slave status, and active defragmentation to `info` metricset of Redis module. {pull}7695[7695]
- Increase ignore_above for system.process.cmdline to 2048. {pull}8101[8100]
- Add support to renamed fields planned for redis 5.0. {pull}8167[8167]
- Allow TCP helper to support delimiters. {pull}8278[8278]
- Allow TCP helper to support delimiters and graphite module to accept multiple metrics in a single payload. {pull}8278[8278]


- Add `metrics` metricset to MongoDB module. {pull}7611[7611]
Expand Down
11 changes: 5 additions & 6 deletions metricbeat/helper/server/tcp/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,18 @@ func (g *TcpServer) watchMetrics() {
continue
}

if conn != nil {
go g.handle(conn)
}
go g.handle(conn)
}
}

func (g *TcpServer) handle(conn net.Conn) {
if conn == nil {
return
}
logp.Debug("tcp", "Handling new connection...")

// Close connection when this function ends
defer func() {
conn.Close()
}()
defer conn.Close()

// Get a new reader with buffer size as the same as receiveBufferSize
bufReader := bufio.NewReaderSize(conn, g.receiveBufferSize)
Expand Down

0 comments on commit 4c5a9b2

Please sign in to comment.