RequestHandler checks only if the connection is an attribute to the request object. By default HTTPRequest has connection=None which going to make the RequestHandler to fail in adding a stream close callback.
Better connection check in RequestHandler
This seems like a good change, but I'm curious how you came across it? The only place we create httpserver.HTTPRequests always passes in a connection, so RequestHandler should never see a request whose connection is None (The hasattr check is actually to distinguish between httpserver.HTTPRequest and wsgi.HTTPRequest)