New issue
Advanced search Search tips

Issue 908863 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 7
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Duplicate console log messages from worker

Reported by t...@crowder.org, Nov 27

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36

Steps to reproduce the problem:
1. Open a page launching a worker that makes console.log calls when the browser's devtools are closed
2. Open devtools

What is the expected behavior?
See one copy of the messages logged, e.g.:

1543334965526 worker loaded
1543334965527 worker started
1543334965528: From worker: 0.7348785894743377 random 0.8185893729517724

What went wrong?
I see two copies of the messages logged, but only the ones from the worker:

1543335007794 worker loaded
1543335007794 worker started
1543335007794 worker loaded
1543335007794 worker started
1543335007794: From worker: 0.30979388032047006 random 0.9249988190290734

As far as I can tell, the code only actually runs once, I think this is a console problem.

Did this work before? Yes Somewhere in the high 60s, don't know for sure

Chrome version: 70.0.3538.110  Channel: stable
OS Version: 10
Flash Version: 

You can also use this plunker to replicate it:
https://plnkr.co/edit/QWhoQS8hmw5bdXqJ3v4z?p=preview

The key is to have devtools closed when loading the page, *then* open devtools to see the messages.
 
duplicate.html
400 bytes View Download
worker.js
224 bytes View Download
(Sigh, I always forget something.) It's not Windows-specific. I first noticed it on Linux in fact, but have since replicated it on Windows.

Also just checked it with Chrome Canary "72.0.3623.0 (Official Build) canary (64-bit)" and the problem is there, too.
Bisected to r404993 = 63fe38c1e6d9eeefd9036f431456c8a359424fa3 = https://crrev.com/2141673002 by dgozman@chromium.org
"[DevTools] Always send a copy of worker message through the page."
Landed in 54.0.2795.0
Labels: Needs-Bisect Needs-Triage-M70
Cc: swarnasree.mukkala@chromium.org
Labels: -Type-Bug-Regression Triaged-ET Target-72 M-72 FoundIn-71 FoundIn-70 FoundIn-72 OS-Linux OS-Mac Type-Bug
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue on the reported chrome version #70.0.3538.110, latest chrome #72.0.3623.0 using Windows 10, Ubuntu 17.10 and Mac 10.13.6 by following the steps as per comment#0.

The behavior is observed from old M-60 builds(#60.0.3112.113). This is a non-regression issue hence marking it as untraiged and requesting someone from the dev team to look into the issue.
Thanks.!
Apologies for a minor editing error in `worker.js`; doesn't affect replicating the issue, it's just a misleading log statement. Here's the corrected version FWIW.
worker.js
220 bytes View Download
Owner: dgozman@chromium.org
Status: Assigned (was: Untriaged)
Thanks for the bisect!
Labels: -Needs-Bisect
++ As per comment#4.
Cc: dgozman@chromium.org
 Issue 848965  has been merged into this issue.
Project Member

Comment 9 by bugdroid1@chromium.org, Dec 7

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

commit e41224229e7a61deb59a2a5d7bf5175cc56bf14c
Author: Dmitry Gozman <dgozman@chromium.org>
Date: Fri Dec 07 04:46:27 2018

[DevTools] Do not report worker console messages twice

When the worker is still alive while DevTools is being opened,
there is a race between console messages coming from page and
worker target creation.

Bug:  908863 
Change-Id: I9495d4becada0e4f2bd208c0922b2a2a3ea98af9
Reviewed-on: https://chromium-review.googlesource.com/c/1359039
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614609}
[modify] https://crrev.com/e41224229e7a61deb59a2a5d7bf5175cc56bf14c/third_party/blink/renderer/devtools/front_end/browser_sdk/LogManager.js
[modify] https://crrev.com/e41224229e7a61deb59a2a5d7bf5175cc56bf14c/third_party/blink/renderer/devtools/front_end/sdk/ConsoleModel.js

Status: Fixed (was: Assigned)
Labels: TE-Verified-M73 TE-Verified-73.0.3636.0
Able to reproduce the issue on reported chrome version# 70.0.3538.110 using Windows 10, Ubuntu 17.10 and Mac 10.13.6 by following steps as per comment#0.

Verified the fix on Mac 10.13.6, Windows 10 and Ubuntu 17.10 as per comment#0 on latest chrome version #73.0.3636.0.
Attaching screenshot for reference.
Observed that the console message does not repeat twice.
Hence, the fix is working as expected.
Adding the verified labels.

Thanks...!!
908863_M73.PNG
526 KB View Download

Sign in to add a comment