History

Minor scripting-related fixes

ksuprynowicz committed 3 years ago

Commit 1ad1aee1 parent 5cf32a94 files · +7 −5Browse files

Showing the changes to libraries/script-engine/src/ScriptManager.cpp (1 of 4 files). Show all

Unified · Split

libraries/script-engine/src/ScriptManager.cpp+4−2
@@ -432,17 +432,18 @@ void ScriptManager::waitTillDoneRunning(bool shutdown) { · 431 unmodified lines
432432 while (workerThread->isRunning()) {
433433 // If the final evaluation takes too long, then tell the script engine to stop running
434434 auto elapsedUsecs = usecTimestampNow() - startedWaiting;
435+ // V8TODO: temporarily increased script timeout. Maybe use different timeouts for release and unoptimized debug?
435436 static const auto MAX_SCRIPT_EVALUATION_TIME = USECS_PER_SECOND;
436437 if (elapsedUsecs > MAX_SCRIPT_EVALUATION_TIME) {
437438 workerThread->quit();
438439
439440 if (_engine->isEvaluating()) {
440− qCWarning(scriptengine) << "Script Engine has been running too long, aborting:" << getFilename();
441+ qCWarning(scriptengine) << "Script Engine has been running too long (evaluation), aborting:" << getFilename();
441442 _engine->abortEvaluation();
442443 } else {
443444 auto context = _engine->currentContext();
444445 if (context) {
445− qCWarning(scriptengine) << "Script Engine has been running too long, throwing:" << getFilename();
446+ qCWarning(scriptengine) << "Script Engine has been running too long (event loop), throwing:" << getFilename();
446447 context->throwError("Timed out during shutdown");
447448 }
448449 }
@@ -451,6 +452,7 @@ void ScriptManager::waitTillDoneRunning(bool shutdown) { · 2 unmodified lines
451452 // flooding it with aborts/exceptions will persist it longer
452453 static const auto MAX_SCRIPT_QUITTING_TIME = 0.5 * MSECS_PER_SECOND;
453454 if (!workerThread->wait(MAX_SCRIPT_QUITTING_TIME)) {
455+ Q_ASSERT(false);
454456 workerThread->terminate();
455457 }
456458 }