Search code examples
pythoncontinuous-integrationpytestnetflix-metaflow

How to disable automatic retries of failed Metaflow tasks?


By default, MetaFlow retries failed steps multiple times before the pipeline errors out. However, this is undesired when I am CI testing my flows using pytest-- I just want the flows to fail fast. How do I temporarily disable retries (without hard-coding @retry(times=0) on all steps)?


Solution

  • You can disable it with by setting the METAFLOW_DECOSPECS environment variable: METAFLOW_DECOSPECS=retry:times=0.

    This temporarily decorates all steps with @retry(times=0)-- unless they are already decorated, in which case this won't override the hard-coded retry settings.

    Source: @Ville in the MetaFlow Slack.