reliability: safe waiting and cleanup calls for running tasks