New issue
Advanced search Search tips

Issue 672602 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

BoundedFileNetLogObserver may post many Flush tasks

Project Member Reported by eroman@chromium.org, Dec 8 2016

Issue description

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.
 
Status: Fixed (was: Assigned)

Sign in to add a comment