Added optimistic flag to allow configuration for optimistic or pessimistic evaluation of retry policies.