Skip to content

Commit

Permalink
Cleanly terminate openTSDB connection on EOF
Browse files Browse the repository at this point in the history
This is not really an error, so don't log it.
  • Loading branch information
otoolep committed Sep 9, 2015
1 parent 7a56f15 commit fef20c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ With this release InfluxDB is moving to Go 1.5.
- [#3881](https://github.com/influxdb/influxdb/issues/3881): panic: runtime error: invalid memory address or nil pointer dereference
- [#3926](https://github.com/influxdb/influxdb/issues/3926): First or last value of `GROUP BY time(x)` is often null. Fixed by [#4038](https://github.com/influxdb/influxdb/pull/4038)
- [#4053](https://github.com/influxdb/influxdb/pull/4053): Prohibit dropping default retention policy.
- [#4060](https://github.com/influxdb/influxdb/pull/4060): Don't log EOF error in openTSDB input.

## v0.9.3 [2015-08-26]

Expand Down
6 changes: 5 additions & 1 deletion services/opentsdb/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const (
statTelnetConnectionsHandled = "tl_connections_handled"
statTelnetPointsReceived = "tl_points_rx"
statTelnetBytesReceived = "tl_bytes_rx"
statTelnetReadError = "tl_read_err"
statBatchesTrasmitted = "batches_tx"
statPointsTransmitted = "points_tx"
statBatchesTransmitFail = "batches_tx_fail"
Expand Down Expand Up @@ -244,7 +245,10 @@ func (s *Service) handleTelnetConn(conn net.Conn) {
for {
line, err := r.ReadLine()
if err != nil {
s.Logger.Println("error reading from openTSDB connection", err.Error())
if err != io.EOF {
s.statMap.Add(statTelnetReadError, 1)
s.Logger.Println("error reading from openTSDB connection", err.Error())
}
return
}
s.statMap.Add(statTelnetPointsReceived, 1)
Expand Down

0 comments on commit fef20c7

Please sign in to comment.