[HELIX-438] Improve task framework retry logic