Re: [v8-users] Re: How to rescue issues caused by v8::Isolate termination

2018-11-28 Thread Yang Guo
I'm assuming tests with the proxy resolver and inspector related tests. Both assume that we can resume after termination. Adding a new API like you suggest indeed might make sense. We would set a flag on the isolate which prevents us from clearing the termination exception. Any opinions on this?

Re: [v8-users] Re: How to rescue issues caused by v8::Isolate termination

2018-11-27 Thread Yuki Shiino
Hi Yang, > I could change V8 to not clear the termination exception so that we always > stay in the terminated mode and not recover. However, from experience I > expect tons of tests to fail if I implemented this change. > By the way, what are "tons of tests"? Are they V8 tests? or Blink tests

Re: [v8-users] Re: How to rescue issues caused by v8::Isolate termination

2018-11-22 Thread Yuki Shiino
> > What you could do is add a check after E1 for >> v8::TryCatch::HasTerminated(), and schedule another >> Isolate::TerminateExecution() if true. You would need to do this for E2 as >> well, if you expect an E3, and so forth. >> > That might be possible by migrating > ExceptionState.RethrowV8Excep

Re: [v8-users] Re: How to rescue issues caused by v8::Isolate termination

2018-11-22 Thread Yutaka Hirano
On Thu, Nov 22, 2018 at 8:53 AM Kentaro Hara wrote: > Would it be hard to make Blink immediately terminate the worker thread > after E1 is forcibly terminated? > > Blink is already doing that for common script execution paths e.g., event > listeners, call functions etc. > Script execution is scat

Re: [v8-users] Re: How to rescue issues caused by v8::Isolate termination

2018-11-22 Thread Yang Guo
I could change V8 to not clear the termination exception so that we always stay in the terminated mode and not recover. However, from experience I expect tons of tests to fail if I implemented this change. What you could do is add a check after E1 for v8::TryCatch::HasTerminated(), and schedule an

Re: [v8-users] Re: How to rescue issues caused by v8::Isolate termination

2018-11-21 Thread Kentaro Hara
Would it be hard to make Blink immediately terminate the worker thread after E1 is forcibly terminated? Blink is already doing that for common script execution paths e.g., event listeners, call functions etc. On Thu, Nov 22, 2018 at 4:34 PM Yutaka Hirano wrote: > Thanks for the reply. > > As K

Re: [v8-users] Re: How to rescue issues caused by v8::Isolate termination

2018-11-21 Thread Yutaka Hirano
Thanks for the reply. As Kentaro said, Blink uses TerminateExecution only when it tries to terminate a worker thread forcibly. The isolation will soon be disposed, and the "recovering" functionality is actually harmful for us. main -T worker --*E1**--*E2** T: Call Termi

Re: [v8-users] Re: How to rescue issues caused by v8::Isolate termination

2018-11-19 Thread Yutaka Hirano
Hi, Let's consider the following sequence. -> time main -T worker --*E1**--*E2***--- T: Call TerminateExecution with the worker isolate (on the main thread) E1: bottom-most script evaluation (* means running) E2: bottom-most script evaluation (*

Re: [v8-users] Re: How to rescue issues caused by v8::Isolate termination

2018-11-18 Thread Yang Guo
Sorry. I should have been more explicit here. My image of the stack is growing bottom up. So A is the bottom-most V8 call. Yang On Mon, Nov 19, 2018 at 5:42 AM Yutaka Hirano wrote: > Hi, > > I found I don't understand the direction. If there are only two levels, > say blink-calls-v8(A)-calls-bl

Re: [v8-users] Re: How to rescue issues caused by v8::Isolate termination

2018-11-18 Thread Yutaka Hirano
Hi, I found I don't understand the direction. If there are only two levels, say blink-calls-v8(A)-calls-blink-calls-v8(B), which is the bottom-most v8 call, A or B? Thanks, On Fri, Nov 16, 2018 at 6:30 PM Yutaka Hirano wrote: > Hi Yang, > > Thank you for the information! > Sorry for the late r

Re: [v8-users] Re: How to rescue issues caused by v8::Isolate termination

2018-11-16 Thread Yutaka Hirano
Hi Yang, Thank you for the information! Sorry for the late response. I will send a reply next week. Thanks, On Thu, Nov 15, 2018 at 9:33 PM Kentaro Hara wrote: > I found that at the only place Isolate::TerminateExecution is called >>

[v8-users] Re: How to rescue issues caused by v8::Isolate termination

2018-11-15 Thread Kentaro Hara
> > I found that at the only place Isolate::TerminateExecution is called > > from > blink, V8 is not even running. That would mean that we don't have to worry > abo

[v8-users] Re: How to rescue issues caused by v8::Isolate termination

2018-11-15 Thread Yang Guo
Hi, I found that at the only place Isolate::TerminateExecution is called from blink, V8 is not even running. That would mean that we don't have to worry about any o

[v8-users] Re: How to rescue issues caused by v8::Isolate termination

2018-11-14 Thread Yang Guo
I filed a bug for the slightly counter-intuitive behavior I mentioned: https://bugs.chromium.org/p/v8/issues/detail?id=8455 Cheers, Yang On Wed, Nov 14, 2018 at 9:01 AM Yang Guo wrote: > When you terminate execution in V8, we abort execution until the > bottom-most call into V8. If you have re

[v8-users] Re: How to rescue issues caused by v8::Isolate termination

2018-11-14 Thread Yang Guo
When you terminate execution in V8, we abort execution until the bottom-most call into V8. If you have re-entries into V8, V8 always returns empty results until the bottom-most call into V8. On the Blink side on the stack of the re-entries, you can try to call into V8 before returning, but that wil

[v8-users] Re: How to rescue issues caused by v8::Isolate termination

2018-11-09 Thread Adam Klein
On Thu, Nov 8, 2018 at 8:21 PM Yutaka Hirano wrote: > > As to the problem itself, I have a clarifying questions: doesn't Blink > already have some choke point to determine whether it's "ok to call script > now"? If so that'd be a more natural place to add this handling than > TryCatch. > > No, th

[v8-users] Re: How to rescue issues caused by v8::Isolate termination

2018-11-08 Thread Yutaka Hirano
> As to the problem itself, I have a clarifying questions: doesn't Blink already have some choke point to determine whether it's "ok to call script now"? If so that'd be a more natural place to add this handling than TryCatch. No, there isn't such a point. To make matters worse, some call-sites do

[v8-users] Re: How to rescue issues caused by v8::Isolate termination

2018-11-08 Thread Adam Klein
Adding a couple more V8 folks who may have thoughts. On Thu, Nov 8, 2018 at 1:59 AM Kentaro Hara wrote: > On Thu, Nov 8, 2018 at 1:10 AM Yuki Shiino > wrote: > >> +adamk, cbruni to get more attention from V8 team. This needs V8 team's >> support. >> >> Actually, I intended haraken's (a3) at my

[v8-users] Re: How to rescue issues caused by v8::Isolate termination

2018-11-08 Thread Kentaro Hara
On Thu, Nov 8, 2018 at 1:10 AM Yuki Shiino wrote: > +adamk, cbruni to get more attention from V8 team. This needs V8 team's > support. > > Actually, I intended haraken's (a3) at my proposal (a), but I'm afraid > that changing an existing API HasCaught() would break backward > compatibility. So,

[v8-users] Re: How to rescue issues caused by v8::Isolate termination

2018-11-08 Thread Yuki Shiino
+adamk, cbruni to get more attention from V8 team. This needs V8 team's support. Actually, I intended haraken's (a3) at my proposal (a), but I'm afraid that changing an existing API HasCaught() would break backward compatibility. So, I'm also proposing to add a new V8 API like v8::TryCatch::HasPe

[v8-users] Re: How to rescue issues caused by v8::Isolate termination

2018-11-08 Thread Kentaro Hara
Thanks, I got it :) My proposal would be: (a3) Make HasCaught() return true when the isolate is terminated. I'm not sure if (a) or (a2) is a good idea because the fact that we didn't call ReThrow() means that we (intentionally) suppressed the exception. Thoughts? On Wed, Nov 7, 2018 at 9:51

[v8-users] Re: How to rescue issues caused by v8::Isolate termination

2018-11-07 Thread Yuki Shiino
> > Are you assuming that the worker is terminated while it's calling > DoSomethingElseWithV8()? If yes, why does HasCaught() not return true? If > no, what's a problem of continuing execution? No, the worker is terminated while DoSomethingWithV8 (without "Else"), and Blink continues running more

[v8-users] Re: How to rescue issues caused by v8::Isolate termination

2018-11-07 Thread Kentaro Hara
Sorry, I'm not sure if I understand your example... On Wed, Nov 7, 2018 at 2:21 AM Yutaka Hirano wrote: > +ricea@ > > On Wed, Nov 7, 2018 at 6:44 PM Yuki Shiino > wrote: > >> Hi V8-team and platform-architecture-dev, >> >> TL;DR: We'd like to extend v8::TryCatch APIs a little. >> >> We're havi

[v8-users] Re: How to rescue issues caused by v8::Isolate termination

2018-11-07 Thread Yutaka Hirano
+ricea@ On Wed, Nov 7, 2018 at 6:44 PM Yuki Shiino wrote: > Hi V8-team and platform-architecture-dev, > > TL;DR: We'd like to extend v8::TryCatch APIs a little. > > We're having an issue how to handle worker termination, i.e. v8::Isolate > termination. Roughly speaking, the situation is like be