The inner timeout outlived the outer one
The gateway times out at five seconds. The service it calls times out at thirty. The database call behind that has no timeout at all.
When the database is slow the gateway returns an error at five seconds, and the service carries on for another twenty-five — holding a thread, a connection and a database session — for a client that has already been told no.
Outside every boundary: Service (FAILED: still going at 30s), Gateway (gives up at 5s), Client (waits 6 seconds), Database (no timeout at all; FAILED: unbounded), an empty slot for the shorter than the gateway, an empty slot for the shorter again, and present Connections: Client calls Gateway (step 1) Gateway calls Service (step 2) Service calls Database (step 3) shorter than the gateway controls Service shorter again, and present controls Database