awslabs / multi-model-server

Multi Model Server is a tool for serving neural net models for inference
Apache License 2.0
998 stars 230 forks source link

Handle invalid input gracefully #779

Closed mikeobr closed 5 years ago

mikeobr commented 5 years ago

Given a MMS custom service that expects JSON as input, If the input is invalid JSON such as { "url": "I missed a quote} MMS will return { "code": 500, "type": "InternalServerException", "message": "Worker died." }

What should instead happen is probably either some 4xx error "could not deserialize input" or somehow allow the custom service to validate/handle erroneous input.

vdantu commented 5 years ago

@mikeobr : We are working on a feature to over-ride any preprocessing done on the incoming requests. In that case, the backend worker will get the message as a binary blob, which can be decoded to 'utf-8' and 'json.loaded' by the backend worker.