serve icon indicating copy to clipboard operation
serve copied to clipboard

Add exception handling in server for when gRPC client closes stream

Open namannandan opened this issue 6 months ago • 0 comments

Description

Based on fix demonstrated in https://github.com/pytorch/serve/pull/3267 with additional exception handling.

The following cases are handled:

  1. 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.
  2. 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.
  3. 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)

namannandan avatar Jul 31 '24 22:07 namannandan