serve
serve copied to clipboard
Add exception handling in server for when gRPC client closes stream
Description
Based on fix demonstrated in https://github.com/pytorch/serve/pull/3267 with additional exception handling.
The following cases are handled:
- If the stream has already been closed by the client, we won't attempt to send a response since we check to see if the stream is still open before attempting to send a response.
- If the stream gets closed after we check to see if the stream is open but before we attempt to send a response, then the exception
IllegalStateException
is caught and handled. This should prevent the worker from dying. - Extend the above two fixes to management and OIP requests as well.
Fixes #3087
Type of change
Please delete options that are not relevant.
- [x] Bug fix (non-breaking change which fixes an issue)
Feature/Issue validation/testing
-
[ ] CI
-
[ ] Manual testing (in-progress)