fablabnbg / VisiCut

DOWNLOAD: https://fablabnbg.github.io/visicut
https://fablabnbg.github.io/visicut
Other
16 stars 2 forks source link

Thunderlaser UDP code: test for busy condition #26

Closed jnweiger closed 6 years ago

jnweiger commented 6 years ago

I've made several torture tests with the current state of the art implementation in https://github.com/jnweiger/ruida-laser/blob/master/udpsendruida.py

There is however a race condition:

jnweiger commented 6 years ago

@kkaempf @mrlinux1, we should try to reproduce the race condition using udpsendruida.py (with sufficient chunk delay) and the original rdworks firing a second upload while the first one is in progress. And see if rdworks checks for another upload alread in progress.

With two (slow) udpsendruida.py I can reproduce the following situation: Sender A sends file 'dolly.rd' in 30 chunks with a 1 second delay between each. Sender B starts 10 seconds later and and sends file 'kringel.rd' in 5 chunks with a 3 second delay between chunks.

The sequence seen on the network is approximately:

A A A A A A A A A A B A A A B A A B A A A B A A A B A A A A A A A A A

The lasercutter shows the name 'dolly' in the display after the last chunk from B is received. This is indicates a premature end of the first upload. The trailing chunks from A seem to be ignored. Afterwards a file 'dolly' is in the file list, but not file 'kringel'.

The file 'dolly' contains a mix of both, and is incomplete.

jnweiger commented 6 years ago

File 'dolly.rd' if transfered correctly: 20180425_001429

File 'kringel.rd' if transfered correctly: 20180425_001456

File 'dolly.rd' with simultanesous upload of 'kringel.rd' as described above: 20180425_001616

Photo with highlights added indicating the sequence of zerhackstückelt Text: 20180425_003756

kkaempf commented 6 years ago

:rofl: