Sort tasks by executor id and handle gc time