cherry picking this commit as @ssnyder thinks it may fix our nightly issues.
Former-commit-id: 1898a734