Improved exception handling to recover from rare unexpected errors.

10 jobs for master in 5 minutes and 23 seconds (queued for 1 minute and 2 seconds)