Won't this raise the exception if there are actually no tasks and it returns in this timeframe?
Instead of raising a non-authoritative TransientError here, how about it immediately do what we should be doing when we get a TransientError, namely try again. It has the benefit of the context of the previous failure. You can make a function that could recurse until it works or hits some contextual limit like a retry.