]> Sergey Matveev's repositories - btrtrc.git/blobdiff - connection.go
Track concurrent chunk writes
[btrtrc.git] / connection.go
index 28152d5a60c13630423f84dcd94ef1cd523d5706..6d11f8ab1334e09e9574b9e9c3830a344e8208dd 100644 (file)
@@ -1326,6 +1326,8 @@ func (c *connection) receiveChunk(msg *pp.Message) error {
        err := func() error {
                cl.unlock()
                defer cl.lock()
+               concurrentChunkWrites.Add(1)
+               defer concurrentChunkWrites.Add(-1)
                // Write the chunk out. Note that the upper bound on chunk writing
                // concurrency will be the number of connections. We write inline with
                // receiving the chunk (with this lock dance), because we want to