summaryrefslogtreecommitdiff
path: root/src/lib/efreet
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-03-17 13:16:53 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-03-17 15:15:25 -0400
commitd0e5564c18139399efc6a5009d7f6bfde4dc8265 (patch)
treed53e25b332dfd349c25f38a439a00cd1cd99fc93 /src/lib/efreet
parent9c4956082a308b45e4f244a02fc67634dcd14616 (diff)
efreet: CRI and fail after 10 attempts to connect to efreetd
if efreetd cannot be connected to, stop infinitely trying to spawn it since this generates crazy cpu load probably this path should also send some cache events so that watchers do not simply idle forever ref T5200
Diffstat (limited to 'src/lib/efreet')
-rw-r--r--src/lib/efreet/efreet_cache.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/efreet/efreet_cache.c b/src/lib/efreet/efreet_cache.c
index a9d5bec428..3a85c120c2 100644
--- a/src/lib/efreet/efreet_cache.c
+++ b/src/lib/efreet/efreet_cache.c
@@ -133,12 +133,14 @@ _cb_server_add(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
133} 133}
134 134
135static Ecore_Timer *reconnect_timer = NULL; 135static Ecore_Timer *reconnect_timer = NULL;
136static unsigned int reconnect_count = 0;
136 137
137static Eina_Bool 138static Eina_Bool
138_cb_server_reconnect(void *data EINA_UNUSED) 139_cb_server_reconnect(void *data EINA_UNUSED)
139{ 140{
140 if (reconnect_timer) ecore_timer_del(reconnect_timer); 141 if (reconnect_timer) ecore_timer_del(reconnect_timer);
141 reconnect_timer = NULL; 142 reconnect_timer = NULL;
143 reconnect_count++;
142 _ipc_launch(); 144 _ipc_launch();
143 if (ipc) 145 if (ipc)
144 { 146 {
@@ -160,6 +162,13 @@ _cb_server_del(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
160 double t; 162 double t;
161 IPC_HEAD(Del); 163 IPC_HEAD(Del);
162 ipc = NULL; 164 ipc = NULL;
165 if (reconnect_count > 10)
166 {
167 reconnect_timer = NULL;
168 CRI("efreetd connection failed 10 times! check for stale socket files in %s/.ecore/efreetd",
169 efreet_runtime_dir_get());
170 return EINA_FALSE;
171 }
163 t = ecore_time_get(); 172 t = ecore_time_get();
164 if ((t - last_del) < 0.5) 173 if ((t - last_del) < 0.5)
165 { 174 {