---
title: "We’re All Just Looking for Connection"
description: "Spikes of EOFError on SQL queries in Quip's Python backend (which also powers Slack canvas) traced back to connection-state checks that only tracked closes initiated by the application."
url: "https://swe.quest/articles/we-re-all-just-looking-for-connection-b10700c8e0417e48"
canonical: "https://slack.engineering/were-all-just-looking-for-connection/"
source: "Slack Engineering"
published: "2024-10-10"
difficulty: "medium"
kind: "Incident"
reading_minutes: 7
tags: ["python","networking","debugging","concurrency","incident-response"]
---

# We’re All Just Looking for Connection

A post on [Slack Engineering](https://swe.quest/sources/slack.md), published 2024-10-10, 7 min read, Incident. Original: [https://slack.engineering/were-all-just-looking-for-connection/](https://slack.engineering/were-all-just-looking-for-connection/)

## Summary

Spikes of EOFError on SQL queries in Quip's Python backend (which also powers Slack canvas) traced back to connection-state checks that only tracked closes initiated by the application. AWS's database proxy began closing connections after 24 hours, and because asyncio's StreamWriter.is\_closing() doesn't reflect a peer-initiated FIN (a socket in CLOSE\_WAIT can still be read), the code never reconnected before issuing queries. Instrumenting the drift between the connected flag and the actual closed state surfaced six more bugs, including websocket false negatives, stale HTTP pool clients and missed Redis cleanup. Fixing them nearly eliminated the errors and unblocked a stalled migration from a custom runtime to asyncio, where an overloaded RPC peer closing pooled connections had caused hanging PDF exports.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Python](https://swe.quest/tags/python.md) (Languages)
- [Networking](https://swe.quest/tags/networking.md) (Infrastructure)
- [Debugging](https://swe.quest/tags/debugging.md) (Engineering practices)
- [Concurrency](https://swe.quest/tags/concurrency.md) (Compilers & runtimes)
- [Incidents & postmortems](https://swe.quest/tags/incident-response.md) (Reliability & operations)

## Prerequisites

- Python asyncio streams ([easy posts on Python](https://swe.quest/tags/python.md?difficulty=easy))
- TCP connection states ([easy posts on Networking](https://swe.quest/tags/networking.md?difficulty=easy))
- connection pooling

## Keywords

asyncio, Quip, Slack canvas, StreamWriter, uvloop, CLOSE\_WAIT, MySQL, RDS Proxy

## Related posts

- [Battling database performance](https://swe.quest/articles/battling-database-performance-5c5eb431f69f9020.md): incident.io · 2023-04-20 · Medium · 10 min read · PostgreSQL, Performance engineering, Observability, Go, Incidents & postmortems
  Intermittent API timeouts at incident.io over two weeks traced back to requests blocking on Go's database/sql client-side connection pool, with no single slow query or pool to blame.
- [parking\_lot: ffffffffffffffff...](https://swe.quest/articles/parking-lot-ffffffffffffffff-e7cd36eac4ddf5cc.md): Fly.io · 2025-05-28 · Hard · 16 min read · Concurrency, Rust, Debugging, Incidents & postmortems, Load balancing
  Fly.io's Rust Anycast router, fly-proxy, kept deadlocking after Catalog state was moved to lazy loading.
- [Incident Report: April 23rd, 2025](https://swe.quest/articles/incident-report-april-23rd-2025-f0e6e4113e1badba.md): Railway · 2025-04-23 · Medium · 4 min read · Incidents & postmortems, Resilience, PostgreSQL, Networking, Caching
  A Google Cloud SQL maintenance window took Railway's networking control plane Postgres read replica offline for about 10 minutes, destabilizing edge, private networking and TCP proxy traffic across all regions, worst in Asia.
- [Data needs its DevOps moment](https://swe.quest/articles/data-needs-its-devops-moment-d7c45f88ee69de4f.md): Render · 2026-10-08 · Medium · 9 min read · Stream processing, Data pipelines, Observability, Debugging, Memory management
  Data pipelines should be treated like any other production service: defined as code in the producing team's repo, with portable SQL logic tested in CI, and run 24x7 against SLOs for lag, freshness and completeness.
- [Incident Report: June 6th, 2025](https://swe.quest/articles/incident-report-june-6th-2025-9658b33640a716b2.md): Railway · 2025-06-06 · Medium · 3 min read · Incidents & postmortems, Resilience, Real-time systems, Identity & auth
  Database connection pressure at Railway tripped backend circuit breakers, which set off aggressive websocket reconnects from every connected client at once.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
