Issue metadata
Sign in to add a comment
|
Breakpoints don't stop webworker execution
Reported by
travis.g...@googlemail.com,
Apr 1 2017
|
||||||||||||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36 Steps to reproduce the problem: 1. Have one or more webworkers running 2. Set a breakpoint somewhere in the code that is reachable by workers and/or the main thread 3. When the debugger breaks on the breakpoint, webworkers continue running What is the expected behavior? At least in previous versions, web worker execution halted. What went wrong? In my application, I use web workers to send messages to the main thread to do something. When you're trying to debug that *something*, other invocations of that same code (via workers) modify variables while you're debugging them, making debugging in general quite messy. Did this work before? Yes 56.xxx Chrome version: 57.0.2987.133 Channel: stable OS Version: 10.0 Flash Version: Shockwave Flash 25.0 r0 I'm not sure if this is actually unintentional, but at least an optional feature to break all workers when any of the web workers or the main thread break on a breakpoint (or when you manually pause one of them) would be very nice. As is, debugging code as in the situation described above is not really possible. It's also possible I'm missing something and the observed behavior is caused by something else.
,
Apr 3 2017
,
Apr 4 2017
,
Apr 6 2017
The main thread is single threaded, unless there are timers, promises, or other async things happening, the main thread will not process any message from the worker until the execution stack is finished. We do not want to force the worker to halt as that would be even more confusing since a worker is designed to be able to always execute in another execution context (concurrently). It is possible to write some hooks into your code to assist you in debugging like, set a breakpoint in the worker just before message is sent to main thread then step to after the postMessage occurs then keep worker paused while you debug main thread. This is largely tricky because workers are allowed to queue messaged to main thread or to any channel including other works. This in theory means that works should be able to communicate with each other even if main thread is paused. I am going to mark as WontFix, but if you feel strongly about this we can dive deeper into it. Thanks! |
|||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||
Comment 1 by travis.g...@googlemail.com
, Apr 1 2017