tokahuke / yaque

Yaque is yet another disk-backed persistent queue for Rust.
Other
81 stars 11 forks source link

Certain sequence of bytes can screw up the channel #19

Open jupyterkat opened 1 year ago

jupyterkat commented 1 year ago

I feel like this should be documented somewhere, if you happen to send some bytes that matches the header of yaque, then the queue may cease to function. Happened when I tried to get some messagepack through the channel.

tokahuke commented 1 year ago

Hum... interesting stuff. If I remember correctly, I have accounted for that on one of the versions. Which version are you using exactly?

If this error is on the current version, it should be corrected, not documented.

EDIT: I would also greatly appreciate an example code so that I can use it as unittest. 😄

jupyterkat commented 1 year ago

This is on latest, you can probably get this by serializing with rmp_serde::to_vec() on some structs. I haven't found the exact struct that broke it, since many was in there. But here is the struct in question https://github.com/jupyterkat/BYONDDiffBots/blob/78fba9b1a7e0cbc173a12b949991b65dc13302b4/crates/diffbot_lib/src/job/types.rs#L15 Serialized here (switched to json because it works atm): https://github.com/jupyterkat/BYONDDiffBots/blob/78fba9b1a7e0cbc173a12b949991b65dc13302b4/crates/mapdiffbot2/src/github_processor.rs#L106 The behaviour is that it keeps stuck on waiting for some bytes that never come to the recv end when the job is sent into the queue