You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Im using tornado to build an http proxy between a web client and a storage server. I'm streaming data. I t works well except when the storage server has an error and terminate early. Then the requests is stuck from the client point of view. Do you have an idea how to implement that ? maybe check the connection is up in body_producer ?
If the server returns an error, you'll see it in await self.fetch, but you're not doing that until post, which is called after you've transmitted the entire body. You need to structure things so that you start a task in prepare() to wait on that future and can use that error to shut down the body producer and return the error to the client.
Writing a robust proxy is tricky; I'm not aware of any complete examples of doing this with Tornado. On the other side you also need to handle on_connection_close to handle disconnects from the client.
Im using tornado to build an http proxy between a web client and a storage server. I'm streaming data. I t works well except when the storage server has an error and terminate early. Then the requests is stuck from the client point of view. Do you have an idea how to implement that ? maybe check the connection is up in body_producer ?
The text was updated successfully, but these errors were encountered: