BoundedFileNetLogObserver has a soft-limit for its event buffer, after which it schedules a flush:
https://cs.chromium.org/chromium/src/net/log/bounded_file_net_log_observer.cc?q=%22if+(queue_size+%3E%3D+kNumWriteQueueEvents)+%7B%22&sq=package:chromium&l=263
// If events build up in |write_queue_|, trigger the file thread to drain
// the queue.
if (queue_size >= kNumWriteQueueEvents) {
task_runner_->PostTask(
FROM_HERE, base::Bind(&BoundedFileNetLogObserver::FileWriter::Flush,
base::Unretained(file_writer_), write_queue_));
}
The code above looks like it is overly eager in posting tasks. Once the soft limit threshold is passed, ideally only 1 task is posted to schedule the flushing. While a flush is outstanding there is no need to post additional tasks.
Can probably just change the if to an equality check.
Comment 1 by bugdroid1@chromium.org
, Dec 9 2016