See comment where we discuss the wait_for_mark method