-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CBOR decoding error in replication connection handler #397
Comments
Do you have the actual message body (in cbor)? |
No..... was trying to track that down now 😅 |
cbor
decoding error in replication connection handler
Haven't seen this error in a while 🤔... |
It shown up again here: https://laub.liebechaos.org/WQ3SzzmtSPyfESfLfNEgFA?edit=
|
|
I still can't reproduce this bug on my machine! I've tried limiting the used threads for tokio but no "success" |
logging from within
logging from within
|
Easier to read version: logging from within
logging from within
|
Breaking down what happened to the original message encoded on Peer B: These bytes were sent in one message, it's an incomplete
Then these were sent again (last few bytes from above message), it's an incomplete hash...:
Then these remaining bytes were never sent:
|
In /// Decoder impl parses cbor objects from bytes
impl<Enc, Dec> Decoder for CborCodec<Enc, Dec>
where
for<'de> Dec: Deserialize<'de> + std::fmt::Debug + 'static,
for<'de> Enc: Serialize + std::fmt::Debug + 'static,
{
type Item = Dec;
type Error = CborCodecError;
fn decode(&mut self, buf: &mut BytesMut) -> Result<Option<Self::Item>, Self::Error> {
println!("=== TIME {:?} ===", std::time::SystemTime::now());
println!("=== DECODE BYTES ===");
println!("{:?}", buf);
// Build deserializer
let mut de = serde_cbor::Deserializer::from_slice(&buf);
// Attempt deserialization
let res: Result<Dec, _> = serde::de::Deserialize::deserialize(&mut de);
// If we ran out before parsing, return none and try again later
let res = match res {
Ok(v) => {
println!("=== DECODE OK ===");
println!("{:?}", v);
Ok(Some(v))
}
Err(e) if e.is_eof() => {
println!("=== DECODE EOF ERR ===");
println!("{:?}", e);
return Ok(None) // Added return here
}
Err(e) => {
println!("=== DECODE ERR ===");
println!("{:?}", e);
Err(e.into())
}
};
// Update offset from iterator
let offset = de.byte_offset();
// Advance buffer
buf.advance(offset);
res
}
} |
Sometimes this occurs (still in the eof error block) which seems to be a completely different thing and doesn't actually trigger any unexpected behaviour in p2panda land:
|
I can reproduce the error now when running the node from the You've mentioned that one can set the max. byte length @sandreae? I've tried to find it but couldn't see anything. |
Woah, good you could reproduce the issue! I found this as well in |
This fix got now released in |
Now we use |
The text was updated successfully, but these errors were encountered: