Fix loader termination issues 87/318987/1
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 11 Oct 2024 11:40:01 +0000 (20:40 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Fri, 11 Oct 2024 11:40:01 +0000 (20:40 +0900)
The loader context's reference count is only set to zero in case of
a low memory event, which will result in terminating
the currently running loader process.
This modification aims to fix the issue where the loader process responsible for
handling launch requests gets terminated during an out-of-memory (OOM) situation.

Change-Id: Iaa3c961d29ef1a8726ff53af8cd911ab4504bc27
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/launchpad-process-pool/loader_context.cc

index aa6124687505cbf22ee873dba2843596706881af..26923a091e48c303b0615f3cfc6b4c4cfff2bb7a 100644 (file)
@@ -476,6 +476,8 @@ bool LoaderContext::CanDeactivate(LoaderMethod method) const {
 }
 
 void LoaderContext::UpdateState(LoaderMethod method, bool force) {
+  if (RefCount() > 0) return;
+
   _W("type(%d), loader_name(%s), activated(%d), method(%d), force(%d)",
      GetType(), GetLoaderName().c_str(), activated_, static_cast<int>(method),
      force);