Re-add the retry stuff added in 2d2265ea40d681bc5716fe39f6202643e7d065eb