HomeSoftware Heritage

Return HTTP 503 on AioRpcError

Description

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.

Details

Provenance
vlorentzAuthored on Sep 6 2022, 5:10 PM
vlorentzPushed on Sep 6 2022, 5:54 PM
Differential Revision
D8404: Return HTTP 503 on AioRpcError
Parents
rDGRPH4a7f3f7650a4: Kill GraphServerProcess on test teardown
Branches
Unknown
Tags
Unknown
References
tag: v1.0.2
Tasks
T4497: [sentry] Out of disk space
Build Status
Buildable 31363
Build 49061: test-and-buildJenkins console · Jenkins