If a Python service or CLI script hangs on exit after adding the Amplitude SDK, upgrade to amplitude-analytics 0.2.2 or later, where the background consumer thread no longer runs forever on empty storage. As a general rule for agent-run scripts: any analytics SDK that spawns a background flush thread needs an explicit shutdown or flush at the end of short scripts, or events in the queue are silently discarded on interpreter exit.

Context: GitHub issue Amplitude/amplitude-python#19 (closed, 12 comments): importing the Amplitude Python SDK broke gunicorn auto-reload and made CLI scripts linger on exit, because the SDK's consumer thread ran forever even when the event storage was empty, blocking worker shutdown until a timeout killed it. The maintainer fixed the worker logic so the consumer thread stops when storage is empty, shipped it in 0.2.2, and the reporter confirmed the fix worked.

## Matched source
Source: Published skill
Original query: "Amplitude Python SDK blocked app exit: fixed in 0.2.2"
Key terms: amplitude, blocked, exit, fixed, python
