summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-04-09 20:45:57 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-04-09 20:45:57 +0100
commit6df39f0382e8a398b35c7e18ca547f1bb461bd10 (patch)
treebc27c2cc4b6b6e795383776bebadac174ea96794
parentd74f17239cef6d407503ad938c0391e47a49a060 (diff)
efreet - try less chaotic efreetd restart and delay 0.5-1.0 rand sec
try work on T8490
-rw-r--r--src/lib/efreet/efreet_cache.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/lib/efreet/efreet_cache.c b/src/lib/efreet/efreet_cache.c
index 329bcc7ebc..a34ffd405d 100644
--- a/src/lib/efreet/efreet_cache.c
+++ b/src/lib/efreet/efreet_cache.c
@@ -120,6 +120,8 @@ _ipc_launch(void)
120 int tries = 1000; // 1000 * 10ms == 10sec 120 int tries = 1000; // 1000 * 10ms == 10sec
121 const char *s; 121 const char *s;
122 122
123 ipc = ecore_ipc_server_connect(ECORE_IPC_LOCAL_USER, "efreetd", 0, NULL);
124 if (ipc) return;
123 s = getenv("EFREETD_CONNECT_TRIES"); 125 s = getenv("EFREETD_CONNECT_TRIES");
124 if (s) 126 if (s)
125 { 127 {
@@ -180,7 +182,6 @@ _cb_server_reconnect(void *data EINA_UNUSED)
180static Eina_Bool 182static Eina_Bool
181_cb_server_del(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) 183_cb_server_del(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
182{ 184{
183 static double last_del = 0.0;
184 double t; 185 double t;
185 IPC_HEAD(Del); 186 IPC_HEAD(Del);
186 ipc = NULL; 187 ipc = NULL;
@@ -194,15 +195,10 @@ _cb_server_del(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
194 free(address); 195 free(address);
195 return EINA_FALSE; 196 return EINA_FALSE;
196 } 197 }
197 t = ecore_time_get(); 198 // random 0.5 -> 1.0 sec from now
198 if ((t - last_del) < 0.5) 199 t = (((double)((rand() + (int)getpid()) & 0xff) / 255.0) * 0.5) + 0.5;
199 { 200 if (reconnect_timer) ecore_timer_del(reconnect_timer);
200 if (reconnect_timer) ecore_timer_del(reconnect_timer); 201 reconnect_timer = ecore_timer_add(t, _cb_server_reconnect, NULL);
201 reconnect_timer = ecore_timer_add(0.5, _cb_server_reconnect, NULL);
202 }
203 else
204 _cb_server_reconnect(NULL);
205 last_del = t;
206 return ECORE_CALLBACK_DONE; 202 return ECORE_CALLBACK_DONE;
207} 203}
208 204