reduce try scope
fix cold shutdown
fix quit task
refactor max_run_time test