diff options
author | Anna Henningsen <anna@addaleax.net> | 2016-06-22 23:32:24 +0200 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2016-06-25 05:50:26 +0200 |
commit | 61196dedad873af15adb078b03153aa02dc3463a (patch) | |
tree | 064f31d8f3113134c5b6f0b7ae88a44639c5ac07 /src/node_watchdog.cc | |
parent | efc31503b39afc27c878abbeca15819ace20a663 (diff) | |
download | android-node-v8-61196dedad873af15adb078b03153aa02dc3463a.tar.gz android-node-v8-61196dedad873af15adb078b03153aa02dc3463a.tar.bz2 android-node-v8-61196dedad873af15adb078b03153aa02dc3463a.zip |
vm: test for abort condition of current invocation
When a vm script aborted after a timeout/signal interruption, test
whether the local timeout/signal watchdog was responsible for
terminating the execution.
Without this, when a shorter timer from an outer `vm.run*` invocation
fires before an inner timeout, the inner timeout would throw an error
instead of the outer one, but because it did not witness the timeout
itself, it would assume the termination was the result of a signal
interruption.
PR-URL: https://github.com/nodejs/node/pull/7373
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'src/node_watchdog.cc')
-rw-r--r-- | src/node_watchdog.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/node_watchdog.cc b/src/node_watchdog.cc index 8e94bc8d9d..8a067c27f3 100644 --- a/src/node_watchdog.cc +++ b/src/node_watchdog.cc @@ -99,7 +99,7 @@ void SigintWatchdog::Dispose() { SigintWatchdog::SigintWatchdog(v8::Isolate* isolate) - : isolate_(isolate), destroyed_(false) { + : isolate_(isolate), received_signal_(false), destroyed_(false) { // Register this watchdog with the global SIGINT/Ctrl+C listener. SigintWatchdogHelper::GetInstance()->Register(this); // Start the helper thread, if that has not already happened. @@ -120,6 +120,7 @@ void SigintWatchdog::Destroy() { void SigintWatchdog::HandleSigint() { + received_signal_ = true; isolate_->TerminateExecution(); } |