Enable timeout support for each service handler#891
Enable timeout support for each service handler#891R4R3D1FF wants to merge 4 commits intoconnectrpc:mainfrom
Conversation
Signed-off-by: Mausam Yadav <mausam191003@gmail.com>
decd22f to
b865468
Compare
emcfarlane
left a comment
There was a problem hiding this comment.
Thanks for the PR! I will bring up with the other maintainers to discuss the usability side. For the PR we need to complete testing and documentation.
Co-authored-by: Edward McFarlane <3036610+emcfarlane@users.noreply.github.com> Signed-off-by: R4R3D1FF <118979975+R4R3D1FF@users.noreply.github.com>
acb843f to
91b7827
Compare
Added documentation comments in the new exported options Signed-off-by: R4R3D1FF <118979975+R4R3D1FF@users.noreply.github.com> Signed-off-by: Mausam Yadav <mausam191003@gmail.com>
91b7827 to
cc784c6
Compare
Alright, do you have any ideas as to how I can test this? I think it could be done via a client that intentionally stalls the message sent to or received from the server. |
|
FYI, I've created another PR also to fix this issue, but with added protogen support, so users can set the custom timeouts using an option on the methods, in their I've also added some tests both for the proto generation and handler deadline setting. |
Adds an option for read and write timeout in the handler options, that is passed to the handler config and then to the spec. Finally, ServeHTTP function of the handler reads the timeout values from the spec and enforces them using ResponseController.
This prevents slow or malicious clients from using up resources as that specific stream for the HTTP2 connection can be closed.
Deals with the following issue
#879