Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase the wait for the JavaSrcript thread #807

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion trikScriptRunner/src/trikJavaScriptRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,15 @@ TrikJavaScriptRunner::~TrikJavaScriptRunner()
// The thread has finished, events have been processed above
constexpr auto POLITE_TIMEOUT = 100;
if (!mWorkerThread.wait(POLITE_TIMEOUT)) {
QLOG_FATAL() << "JS thread failed to exit gracefully in" << POLITE_TIMEOUT << "ms";
QLOG_WARN() << "JS thread failed to exit gracefully in" << POLITE_TIMEOUT
<< "ms, re-trying with 3x timeout";
if (!mWorkerThread.wait(3*POLITE_TIMEOUT)) {
QLOG_ERROR() << "JS thread failed to exit gracefully in 3x timeout,"
<< " next attempt is unlimited timeout and may hang";
mWorkerThread.wait();
} else {
QLOG_INFO() << "JS thread succeeded to shutdown with 3x timeout";
}
}
}

Expand Down
Loading