Make retries configurable, also catch ConnectionResetError