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:
-
Slice creation is guarded against a potentially negative size and an error is thrown. That makes existing random panic to disappear.
-
The error gets logged, so we can start tracking when and why this situation even happens.