sid-project / sid

Storage Instantiation Daemon
https://sid-project.github.io
12 stars 5 forks source link

make timeout configurable #112

Open trgill opened 3 years ago

trgill commented 3 years ago

@prajnoha this comment is for when we've got re-usable workers? Currently the kill() won't block, so we don't need a timeout here. (?)

https://github.com/sid-project/sid/blob/cf867f83c90a46aab3f9434896ff818325d9fbac/src/resource/worker-control.c#L356

/* FIXME: Make timeout configurable. If timeout is set to zero, exit worker right away - call
_make_worker_exit.
    *
timeout_usec = util_get_now_usec(CLOCK_MONOTONIC) + DEFAULT_WORKER_IDLE_TIMEOUT_USEC;
sid_resource_create_time_event_source(chan->owner, &worker_proxy->idle_timeout_es, CLOCK_MONOTONIC,
                                                  timeout_usec, 0, _on_worker_proxy_idle_timeout_event, "idle
timeout", chan->owner); _change_worker_proxy_state(chan->owner, WORKER_STATE_IDLE);
*/
prajnoha commented 3 years ago

Yes, indeed, this is for the case when we have reusable workers in place (the pool of workers). And if the worker in the pool stays unused for certain configured time, we'd terminate it...