kompics/kompact

Add more contextual info in buffer errors

haraldng opened this issue · 3 comments

For example if ser/deser fails we only get this: panicked at 'assertion failed: self.remaining() >= dst.len()'. Would be helpful if the serialisation id could be given in the error message.

Okay I think that some of these assertions have to be made in the low level buffer code/the BufMut interface which doesn't return errors and doesn't have access to the serialisation ID's. The panic (should be) caused by trying to send a NetMessage that doesn't fit inside a BufferChunk at all.

WIth the next PR I'm doing (adding Buffer-Chaining) I'll add some assertions in the serialisation method to try and add assertions in the serialisation method such that it would panic before trying to put it into the buffer, if the message is too big.

I seem to get this when receiving a message. And it shouldn't be due to too large message, the message is just 8 bytes.

14: 0x7f89165de581 - <kompact_benchmarks::bench::atomic_broadcast::client::Client as kompact::actors::Actor>::receive_network::hea79e8942f89f761