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
This commit is contained in:
Mike Blumenkrantz 2017-03-17 13:16:53 -04:00
parent 9c4956082a
commit d0e5564c18
1 changed files with 9 additions and 0 deletions

View File

@ -133,12 +133,14 @@ _cb_server_add(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
}
static Ecore_Timer *reconnect_timer = NULL;
static unsigned int reconnect_count = 0;
static Eina_Bool
_cb_server_reconnect(void *data EINA_UNUSED)
{
if (reconnect_timer) ecore_timer_del(reconnect_timer);
reconnect_timer = NULL;
reconnect_count++;
_ipc_launch();
if (ipc)
{
@ -160,6 +162,13 @@ _cb_server_del(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
double t;
IPC_HEAD(Del);
ipc = NULL;
if (reconnect_count > 10)
{
reconnect_timer = NULL;
CRI("efreetd connection failed 10 times! check for stale socket files in %s/.ecore/efreetd",
efreet_runtime_dir_get());
return EINA_FALSE;
}
t = ecore_time_get();
if ((t - last_del) < 0.5)
{