Skip to content

Commit

Permalink
Avoid race condition on logging the buffer size (#884)
Browse files Browse the repository at this point in the history
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
  • Loading branch information
jpkrohling authored and yurishkuro committed Jun 25, 2018
1 parent 3a31eae commit c19b6b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/agent/app/processors/thrift_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ func (s *ThriftProcessor) processBuffer() {
protocol := s.protocolPool.Get().(thrift.TProtocol)
payload := readBuf.GetBytes()
protocol.Transport().Write(payload)
s.server.DataRecd(readBuf) // acknowledge receipt and release the buffer
s.logger.Debug("Span(s) received by the agent", zap.Int("bytes-received", len(payload)))
s.server.DataRecd(readBuf) // acknowledge receipt and release the buffer

if ok, _ := s.handler.Process(protocol, protocol); !ok {
// TODO log the error
Expand Down

0 comments on commit c19b6b0

Please sign in to comment.