palantir / atlasdb

Transactional Distributed Database Layer
https://palantir.github.io/atlasdb/
Apache License 2.0
55 stars 11 forks source link

Avoid reflection when rethrowing exceptions #6931

Closed pkoenig10 closed 9 months ago

pkoenig10 commented 9 months ago

Throwables.rewrap uses reflection to try an reconstruct an exception of the same type with a different message.

pkoenig10 commented 9 months ago

Are we okay losing that? If not, we should probably capture the stacktrace in another way?

See my comment above about adding a suppressed exception:

https://github.com/palantir/atlasdb/pull/6931#discussion_r1465295795

I think it's fine losing the stacktrace in these places. The only place we might want it is the one in PaxosStateLogImpl, but we emit an explicit log line there, which will capture the location.

ergo14 commented 9 months ago

Are we okay losing that? If not, we should probably capture the stacktrace in another way?

See my comment above about adding a suppressed exception:

#6931 (comment)

I think it's fine losing the stacktrace in these places. The only place we might want it is the one in PaxosStateLogImpl, but we emit an explicit log line there, which will capture the location.

Gotcha, apologies, I misunderstood the comment.

svc-autorelease commented 9 months ago

Released 0.1023.0