Handle unexpected panics in trace buffer

What does this MR do?

Handle unexpected panics in trace buffer

We've discovered that in some cases (don't know what, for now!) trace buffer panics. Apparently the offset that is referenced from the trace is bigger than the amount of bytes that were written to the buffer.

Today that ends with a nasty panic. With this commit we will get two changes:

  1. Slice creation is guarded against a potentially negative size and an error is thrown. That makes existing random panic to disappear.

  2. The error gets logged, so we can start tracking when and why this situation even happens.

Why was this MR needed?

What's the best way to test this MR?

What are the relevant issue numbers?

Merge request reports

Loading