think about max-retry time e.g. stop trying after 5 failures