Added grace period to health check and moved health check into TaskInfo.

Review: https://reviews.apache.org/r/22519