New issue
Advanced search Search tips

Issue 745877 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug
Proj-Servicification



Sign in to add a comment

--log-net-log doesn't work

Project Member Reported by eroman@chromium.org, Jul 18 2017

Issue description

I ran a trunk build of Chrome with --log-net-log, and ended up with an invalid log file.

Not sure what caused this (could be one of my recent changes).
The problem is reproducible for me.

Logging via chrome://net-export/ by contrast is resulting in a working log file.

If this is a regression should sort it out before M61 branches.
 

Comment 1 by eroman@chromium.org, Jul 18 2017

From testing, appears to be a regression from:

https://chromium.googlesource.com/chromium/src/+/81b0a99860c6fe445637371a5322a468b237fb72

Comment 2 by eroman@chromium.org, Jul 18 2017

Cc: mmenke@chromium.org
The problem is that there are 2 FileNetLogObserver classes being instantiated that write to the same file.

The first one is the one I expect:
   net_log::ChromeNetLog::StartWritingToFile().

However a bit later, there is also:
  content::NetworkServiceImpl::MojoNetLog::MojoNetLog().


Matt, what is the solution for this? One possibility is to change the command-line used by MojoNetLog so it doesn't trigger in this case. But I don't know much about the NetworkService and how it is expected to co-habitate and share command line flags with Chrome.

Comment 3 by mmenke@chromium.org, Jul 18 2017

Oops!  I added the in-process bogus NetworkService just last week.  My suggestion is to make NetworkService ignore the command line command line flags when creating in-process (When created with NetworkService::Create).

Comment 4 by mmenke@chromium.org, Jul 18 2017

This does seem ugly, but I'll need to be adding other magic for that path, too (Like making a NetworkChangeNotifier only when it's out of process.  Will need to come up with something prettier long term, though)

Comment 5 by eroman@chromium.org, Jul 18 2017

Is the difference in NetworkService construction that |registry| will be nullptr when doing inprocess/test construction and non-nullptr otherwise?

(Looking for where to make the decision to inspect netlog command line flags).

Comment 6 by mmenke@chromium.org, Jul 18 2017

It's also nullptr in unit tests, and I suspect we want to construct the full object in unit tests, so I'd suggest a separate constructor for the ::Create path instead (Or add another constructor parameter).

Comment 7 by mmenke@chromium.org, Jul 18 2017

Components: Internals>Network>Service

Comment 8 by mmenke@chromium.org, Jul 18 2017

Eventually, we'll want to always use the one the NetworkService creates, at which point we can get rid of the current ChromeNetLog, but I think that's a bit too much work to worry about now (Logging network changes and net-export are the two big things, off the top of my head, though sure there are others)

Comment 9 by eroman@chromium.org, Jul 18 2017

Status: Started (was: Assigned)
Project Member

Comment 10 by bugdroid1@chromium.org, Jul 18 2017

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

commit 4eca3b25f42e96ab59dfc0e8c4811ae7d7fad404
Author: Eric Roman <eroman@chromium.org>
Date: Tue Jul 18 21:53:21 2017

Don't write to --log-net-log from MojoNetLog when running in-process.

Bug:  745877 
Change-Id: I05d3fcdbe55509d808f0ab696b159ca22876a0b8
Reviewed-on: https://chromium-review.googlesource.com/576358
Reviewed-by: Matt Menke <mmenke@chromium.org>
Commit-Queue: Eric Roman <eroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487621}
[modify] https://crrev.com/4eca3b25f42e96ab59dfc0e8c4811ae7d7fad404/content/network/network_service_impl.cc

Status: Fixed (was: Assigned)
Components: -Internals>Network>Service Internals>Services>Network
Apologies, applied the wrong component in bulk.

Sign in to add a comment