internalsGet Pro

Module 03 · Lesson 7 of 10Pro

Errors, retries and logging in pipeline code

Level
Intermediate
Topic
Python for data engineering
Reading time
16 min

When you finish this page you can

  1. Sort a pipeline’s errors into ones worth retrying and ones that must stop the run, and explain why each belongs where it does.
  2. Choose the smallest step to retry, and check that repeating it can’t change the result.
  3. Write a retry helper with growing waits, an attempt limit and a time limit, using only the standard library.
  4. Set up logging so the person who reads the log at 06:00 can tell what ran, what retried and why the night failed.

Builds on 2 lessons

Start with lesson 415 min
  1. Pulling data from APIs: pagination and rate limits15 min
  2. Reading and writing databases from Python16 min

A 40-second outage cost Daniel his morning

At 01:06:52 on Tuesday 10 November, the payment provider answers page 412 with 503, Service Unavailable. Forty seconds later it is working again. By then, Meera’s nightly job has already stopped.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan