New issue
Advanced search Search tips

Issue 731906 link

Starred by 1 user

Issue metadata

Status: Archived
Owner:
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug

Blocking:
issue 715263



Sign in to add a comment

Make SingleLogSource more robust: file rotation and log size

Project Member Reported by sque@chromium.org, Jun 9 2017

Issue description

SingleLogSource is pretty dumb right now.

It needs to handle log file rotation on Chrome OS.

It also needs to avoid sending an entire log file when unnecessary. Think /var/log/messages on a system with many reboots.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/966a94e0171ca74455e97cb930d03d235d853895

commit 966a94e0171ca74455e97cb930d03d235d853895
Author: sque <sque@chromium.org>
Date: Tue Jun 13 20:01:22 2017

Refactor SingleLogSource for better test coverage

Instead of providing a test file handle, provide an entire log file
directory based on what is actually on a Chrome OS system.

BUG= chromium:731906 
TEST=unit test passes

Review-Url: https://codereview.chromium.org/2939543002
Cr-Commit-Position: refs/heads/master@{#479112}

[modify] https://crrev.com/966a94e0171ca74455e97cb930d03d235d853895/chrome/browser/chromeos/system_logs/single_log_source.cc
[modify] https://crrev.com/966a94e0171ca74455e97cb930d03d235d853895/chrome/browser/chromeos/system_logs/single_log_source.h
[modify] https://crrev.com/966a94e0171ca74455e97cb930d03d235d853895/chrome/browser/chromeos/system_logs/single_log_source_unittest.cc

Project Member

Comment 2 by bugdroid1@chromium.org, Jun 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b68e3bed1ed8f2b84cbc53c8ce9a3dc7a2536858

commit b68e3bed1ed8f2b84cbc53c8ce9a3dc7a2536858
Author: sque <sque@chromium.org>
Date: Tue Jun 13 21:20:25 2017

SingleLogSource reads whole lines whenever possible

Previously, if SingleLogSource found no newline at the end of a read,
it would reset the file read offset and return nothing.

With this patch, it will return as many whole lines with newlines at
the end as it possibly can, and update the file read offset.

BUG= 731906 
TEST=unit tests pass

Review-Url: https://codereview.chromium.org/2930383002
Cr-Commit-Position: refs/heads/master@{#479154}

[modify] https://crrev.com/b68e3bed1ed8f2b84cbc53c8ce9a3dc7a2536858/chrome/browser/chromeos/system_logs/single_log_source.cc
[modify] https://crrev.com/b68e3bed1ed8f2b84cbc53c8ce9a3dc7a2536858/chrome/browser/chromeos/system_logs/single_log_source_unittest.cc

Project Member

Comment 3 by bugdroid1@chromium.org, Jun 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bc3c128e15e218688cd067a17e5966fce4364ec1

commit bc3c128e15e218688cd067a17e5966fce4364ec1
Author: sque <sque@chromium.org>
Date: Tue Jun 13 23:07:25 2017

SingleLogSource handles rotation of log files

By observing underlying file inode values, SingleLogSource can tell
when a log file has been rotated (renamed and then replaced). When this
state is detected, SingleLogSource will read the remainder of the old
log file and then start reading from the new log file.

BUG= 731906 
TEST=unit tests pass

Review-Url: https://codereview.chromium.org/2940493002
Cr-Commit-Position: refs/heads/master@{#479194}

[modify] https://crrev.com/bc3c128e15e218688cd067a17e5966fce4364ec1/chrome/browser/chromeos/system_logs/single_log_source.cc
[modify] https://crrev.com/bc3c128e15e218688cd067a17e5966fce4364ec1/chrome/browser/chromeos/system_logs/single_log_source.h
[modify] https://crrev.com/bc3c128e15e218688cd067a17e5966fce4364ec1/chrome/browser/chromeos/system_logs/single_log_source_unittest.cc

Comment 4 by sque@chromium.org, Aug 8 2017

Status: Fixed (was: Started)

Comment 5 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)

Sign in to add a comment