chipsenkbeil / over-there

Tool to enable editing, management, and execution remotely from "over there."
Apache License 2.0
0 stars 0 forks source link

Figure out why TCP transport mode failing on occasion with decode error #3

Open chipsenkbeil opened 4 years ago

chipsenkbeil commented 4 years ago

Seems like TCP is rarely failing with a decode error about an invalid marker something.

Shouldn't be getting to the point of an invalid packet as we only yield data back once we have collected it all. My thought there is that the collection STILL has a bug somewhere during shifting that results in losing some of the beginning portion of the packet.

That or it's related to the fact that we're cheating right now by going over the transmission size by N bytes where N is the size of the delimiter used with each TcpStream write.

To test, need to run test a bunch:

for run in {1..1000}; do cargo test >& /tmp/results || {echo "FAILED $run" && break}; done

For specific test:

for run in {1..1000}; do cargo test tcp_send_recv_multi >& /tmp/results || {echo "FAILED $run" && break}; done

Doesn't always appear! May need to run with a higher number to get results eventually. Alternatively, may have better success spamming more msgs beyond 100 in each individual test. Seems like the limit with encryption for 2.5s is around 800 to be safe.

chipsenkbeil commented 4 years ago

Note that this was an issue I made on my personal Gitea instance back when transport used msgpack instead of cbor and the project was split into multiple workspaces.

I believe TCP still has issues, but they may surface differently.