Page MenuHomeSoftware Heritage

RPC server: explicitly handle sentry exception capture
ClosedPublic

Authored by olasd on Apr 13 2022, 3:09 PM.

Details

Summary

The error handler for RPC server classes is used for both unexpected
exceptions (using a 5xx status code), and exceptions used for the normal
execution flow, which are encoded on the server side, and decoded to be
raised again on the client side (and use a 4xx status code). We only
record sentry errors for the 5xx class exceptions.

Test Plan

rpc client/server tests updated to check both behaviors

Diff Detail

Repository
rDCORE Foundations and core functionalities
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D7566 (id=27419)

Rebasing onto ab170ca98c...

Current branch diff-target is up to date.
Changes applied before test
commit b0fff3225d3078e3fcb81bef6bdbe5407b600d17
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Apr 13 14:16:45 2022 +0200

    RPC server: explicitly handle sentry exception capture
    
    The error handler for RPC server classes is used for both unexpected
    exceptions (using a 5xx status code), and exceptions used for the normal
    execution flow, which are encoded on the server side, and decoded to be
    raised again on the client side (and use a 4xx status code). We only
    record sentry errors for the 5xx class exceptions.

See https://jenkins.softwareheritage.org/job/DCORE/job/tests-on-diff/389/ for more details.

olasd requested review of this revision.Apr 13 2022, 3:11 PM
ardumont added a subscriber: ardumont.

Nice

we actually no longer have anything to do in the vault now.
With this landed and released, the NotFoundExc won't be raised server side.

This revision is now accepted and ready to land.Apr 13 2022, 3:18 PM

Build is green

Patch application report for D7566 (id=27438)

Rebasing onto c7f1b6880b...

Current branch diff-target is up to date.
Changes applied before test
commit 5723f00a2af42b3f76276de28799b1f84533efb4
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Apr 13 14:16:45 2022 +0200

    RPC server: explicitly handle sentry exception capture
    
    The error handler for RPC server classes is used for both unexpected
    exceptions (using a 5xx status code), and exceptions used for the normal
    execution flow, which are encoded on the server side, and decoded to be
    raised again on the client side (and use a 4xx status code). We only
    record sentry errors for the 5xx class exceptions.

See https://jenkins.softwareheritage.org/job/DCORE/job/tests-on-diff/394/ for more details.