Gracefully handle a client closing the connection in the middle of a response being streamed
When requesting a streamed list of nodes from swh.graph, a naive client could decide to close the connection early (e.g. if it has found a node it was looking for).
In the current implementation, this makes the swh.graph aiohttp worker hang until the write to the closed socket times out (with a traceback). This takes several minutes, which makes it fairly easy to exhaust all aiohttp workers, and is a waste of resources in general.
We should figure out how to propagate the socket closure through all layers more eagerly.
Migrated from T3259 (view on Phabricator)