From 23591b8ab7917a239daa055dc862728fa8a911de Mon Sep 17 00:00:00 2001
From: andreykproductengine <andreykproductengine@lindenlab.com>
Date: Mon, 1 Jul 2019 17:28:58 +0300
Subject: SL-3704 Plugin exit issues

---
 indra/llplugin/llpluginprocesschild.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'indra/llplugin')

diff --git a/indra/llplugin/llpluginprocesschild.cpp b/indra/llplugin/llpluginprocesschild.cpp
index e24d222cb6..8fb3054eac 100644
--- a/indra/llplugin/llpluginprocesschild.cpp
+++ b/indra/llplugin/llpluginprocesschild.cpp
@@ -33,7 +33,7 @@
 #include "llpluginmessagepipe.h"
 #include "llpluginmessageclasses.h"
 
-static const F32 GOODBYE_SECONDS = 20.0f;
+static const F32 GOODBYE_SECONDS = 12.0f; // Do not set it to be bigger than mPluginLockupTimeout or parent will kill LLPluginProcessChild
 static const F32 HEARTBEAT_SECONDS = 1.0f;
 static const F32 PLUGIN_IDLE_SECONDS = 1.0f / 100.0f;  // Each call to idle will give the plugin this much time.
 
@@ -218,6 +218,11 @@ void LLPluginProcessChild::idle(void)
 			if (mWaitGoodbye.hasExpired())
 			{
 				LL_WARNS() << "Wait for goodbye expired.  Advancing to UNLOADED" << LL_ENDL;
+				if (mInstance != NULL)
+				{
+					// Something went wrong, at least make sure plugin will terminate
+					sendMessageToPlugin(LLPluginMessage("base", "force_exit"));
+				}
 				setState(STATE_UNLOADED);
 			}
 			break;
-- 
cgit v1.2.3