Digg v4 Launch Failure Caused by a Python Default Argument Bug
A real‑world incident at Digg shows how using a mutable default argument in a Python function caused a cascade of performance problems, leading to a rushed v4 release, service outages, and ultimately the company's decline and acquisition.
In 2011 Marc Andreessen warned that software was swallowing the world, and a single bug can undermine an entire product. Years later, a technology blogger recounted how a disastrous software version release contributed to the collapse of Digg, once valued at $160 million.
Background – Digg, founded in 2004, let users submit and vote on news items, using internal algorithms to surface popular content. The platform grew quickly but also attracted intense competition and internal challenges.
Will Larson, a software engineer at Digg, described in a 2018 blog post the company’s turmoil: leadership turnover, engineer attrition, algorithm manipulation, and a broken development environment that left the team without a rollback plan during a critical deployment.
To revive the product, Digg rewrote version 3.5 and prepared a rushed launch of Digg v4, hoping it would be the company’s last chance to compete.
During the hurried rollout, the team switched servers without a proper rollback plan, leading to a maintenance page and a decision to push forward. Shortly after the switch, pages began failing to load, and the team blamed Cassandra, expanding memcache usage as a temporary fix.
Login‑only pages like MyNews broke, forcing the team to replace the default page with a generic TopNews view. Persistent issues led to a complete rewrite of MyNews using Redis, but the underlying problem remained.
The root cause was a Python function in the Digg API server that used mutable default arguments:
<code>def get_user_by_ids(ids=[])</code>Python evaluates default arguments only once, so the same list was reused across calls, accumulating user IDs and names. This caused the list to grow dramatically, overwhelming the memcache cluster and crashing the service.
<code>def f(l=[]):
l.append(1)
print(l)
f()
# [1]
f()
# [1, 1]
f()
# [1, 1, 1]</code>After weeks of investigation, the team fixed the bug, Digg v4 launched successfully, but the damage was done: a new CEO arrived, followed by a third round of layoffs, and a year later Digg was acquired for $500 000.
Will Larson concluded that the v4 release is often cited as a catastrophic example, emphasizing that releasing a flawed product can have severe financial consequences, and that the lesson lies in avoiding mutable default arguments in Python.
Python Programming Learning Circle
A global community of Chinese Python developers offering technical articles, columns, original video tutorials, and problem sets. Topics include web full‑stack development, web scraping, data analysis, natural language processing, image processing, machine learning, automated testing, DevOps automation, and big data.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.