ClarkuCSCI / pydiode

Transfer data through a unidirectional network (i.e., a data diode)
MIT License
2 stars 0 forks source link

Error: "tar" exited prematurely. #17

Closed peterstory closed 3 weeks ago

peterstory commented 3 weeks ago

On the receiver, I occasionally get the error: Error: "tar" exited prematurely.

Which is issued by this line of code: https://github.com/ClarkuCSCI/pydiode/blob/main/src/pydiode/gui/common.py#L47

My reasoning for these errors: if the tar process exits before pydiode, then pydiode can get stuck waiting for a process to read its STDOUT. In this case, we terminate pydiode. However, process exit order is nondeterministic, so sometimes tar appears to exit before pydiode, even when both processes complete normally.

I will check whether simply omitting these errors resolves things.

To trigger the issue with benign behavior, I send files repeatedly:

while sleep 2; do python -m pydiode.tar create ~/Downloads/example* \
  | pydiode send 10.0.1.255 10.0.1.2 --port 1234 --max-bitrate 1000000000 --redundancy 2; done

To trigger a premature exit with an actual error, follow the procedure described in #5. That is, send a large transfer, cancel it midway, then send it again.

peterstory commented 3 weeks ago

Here is an approach which works well:

I repeatedly sent files for 15 minutes, and despite many cases where tar exited prematurely, the GUI behaved as expected (it kept receiving files, and no errors were displayed).

Also, an error message is displayed when an actual transfer error occurs (i.e., send a large transfer, cancel it midway, then send it again).