Nir Soffer has posted comments on this change.
Change subject: schedule: Introduce scheduling libary ......................................................................
Patch Set 4:
(1 comment)
http://gerrit.ovirt.org/#/c/29607/4/lib/vdsm/schedule.py File lib/vdsm/schedule.py:
Line 82: """ Line 83: Schedule callable to be called after delay seconds on the scheduler Line 84: thread. Line 85: Line 86: Callable must not block or take excessive time to complete. It it does
Fine, but then what's the advantage of having a private executor thread ins
The advantage is that both scheduler and thread pool are decoupled, and you can build various solutions by mixing them or using them separately.
I prefer simple reusable parts that I can combine in smart ways over complex parts that I have to fight to make it do what I want and live with their bloat.
This achive your goals: - scheduler does only scheduling, does not now anything about executors/threadpools - threadpool/executor execute stuff
For example, lets say the thread pool as limited queue - who will handle the case where the queue is full?
We don't like the scheduler to deal with this, since it is not related to scheduling. *Your* code should deal with this case, therefore *your* code should schedule itself to dispatch a task on the threadpool, and it should know how to handle a full queue - for example, by delaying the scheduled task again, or failing, whatever. This is application policy and the scheduler does not care about it. Line 87: not finish quickly, it may delay other scheduled calls on the scheduler Line 88: thread. Line 89: Line 90: Returns a ScheduledCall that may be canceled if callable was not called