Skip to content

Return HTTP 503 on AioRpcError

AioRpcError exceptions used to trigger the default error handler of SWH's RPC framework, which msgpacks the exception.

Under some circumstances, this caused the msgpack to hit recursion limits, and logged very large errors to Sentry.

Additionally, SimpleTraversalView now calls wait_for_connection() before returning 200; which allows catching some gRPC errors early and returning 503 instead.

This does not work all the time though; gRPC errors occuring in the middle of the stream still raise ChunkedEncodingError on the client side, but there is not much we can do about that.

Depends on !136 (closed).

Resolves the issue that caused this instance of swh/infra/sysadm-environment#4497 (closed).


Migrated from D8404 (view on Phabricator)

Merge request reports