Fix a bug about hydra loader 66/215666/2
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 14 Oct 2019 05:54:08 +0000 (14:54 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 14 Oct 2019 07:03:39 +0000 (16:03 +0900)
After a new package is installed, the launchpad has to send SIGKILL
signal to the running hydra loaders.

Change-Id: Ia44e768c893fb8ffe1680452b3688e8fd3ccb552
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/launchpad.c

index cf54b45..2fc5c02 100755 (executable)
@@ -1357,7 +1357,6 @@ static gboolean __handle_hydra_client_event(gpointer data)
                SECURE_LOGE("Type %d hydra process was " \
                                "(POLLHUP|POLLNVAL), pid: %d",
                                cpc->type, cpc->hydra_pid);
-               cpc->hydra_pid = HYDRA_NONE;
                __dispose_hydra_process(cpc);
                __prepare_candidate_process(cpc->type, cpc->loader_id);
                return G_SOURCE_REMOVE;
@@ -1509,7 +1508,13 @@ static gboolean __handle_label_monitor(gpointer data)
 
        while (iter) {
                cpc = (candidate_process_context_t *)iter->data;
-               if (cpc->pid > 0) {
+               if (cpc->is_hydra) {
+                       if (cpc->hydra_pid > 0) {
+                               __dispose_hydra_process(cpc);
+                               __prepare_candidate_process(cpc->type,
+                                               cpc->loader_id);
+                       }
+               } else if (cpc->pid > 0) {
                        __dispose_candidate_process(cpc);
                        __prepare_candidate_process(cpc->type, cpc->loader_id);
                }