Set HIGHEST priority to APP_CLEAN_NAMESPACE event 69/319669/5
authorDariusz Michaluk <d.michaluk@samsung.com>
Mon, 10 Feb 2025 11:10:13 +0000 (12:10 +0100)
committerTomasz Swierczek <t.swierczek@samsung.com>
Fri, 14 Feb 2025 16:06:26 +0000 (16:06 +0000)
Change-Id: Id6513fd06ccdb631d0a2f550e25cc968adbf402a

src/client/include/client-request.h
src/server/main/include/service-thread-dispatcher.h

index 76bd38547a1ceeb7fbd86cdd568e29b277ab71a6..f0aaeae67a499b3267e2c92426c248a6eb05ae47 100644 (file)
@@ -44,8 +44,8 @@ class ClientRequest {
 
     static Priority getPriority(SecurityModuleCall action) {
         auto priority = Priority::LOW;
-        if (action == SecurityModuleCall::PREPARE_APP) {
-            // highest priority for app launching
+        if (action == SecurityModuleCall::PREPARE_APP || action == SecurityModuleCall::APP_CLEAN_NAMESPACE) {
+            // highest priority for app launching & cleanup
             priority = Priority::HIGHEST;
         } else {
             resource_pid_t proc_data;
index 05e909245b9bc59e70e2db20b58736e2b6530e56..d93152587112945f9be4beacca2756d6dddf54c1 100644 (file)
@@ -79,10 +79,11 @@ public:
     void PutEvent(Priority priority, T&&...arg) {
         assert(priority < arraySize(m_eventQueues));
         auto event = new Event{ std::forward<T>(arg)... };
-        if (event->callType() == SecurityModuleCall::PREPARE_APP)
+        if (event->callType() == SecurityModuleCall::PREPARE_APP ||
+            event->callType() == SecurityModuleCall::APP_CLEAN_NAMESPACE)
         {
             if (priority != Priority::HIGHEST)
-                LogError("Gotcha, client sent improper priority for PREPARE_APP!");
+                LogError("Gotcha, client sent improper priority for PREPARE_APP or APP_CLEAN_NAMESPACE!");
             {
                 std::lock_guard<std::mutex> lock(m_hi_prio_eventQueueMutex);
                 m_eventQueues[priority].emplace(event);
@@ -91,7 +92,7 @@ public:
         } else
         {
             if (priority == Priority::HIGHEST)
-                LogError("Gotcha, client sent high-priority non-PREPARE_APP Event!");
+                LogError("Gotcha, client sent high-priority non-PREPARE_APP or APP_CLEAN_NAMESPACE Event!");
             {
                 std::lock_guard<std::mutex> lock(m_eventQueueMutex);
                 m_eventQueues[priority].emplace(event);