pyexiftool icon indicating copy to clipboard operation
pyexiftool copied to clipboard

don't hang if exiftool unexpectedly exits

Open diekhans opened this issue 2 years ago • 2 comments

The select loop from exiftool does not check for EOF, causing some expect failure to cause pyexiftool to hang.

This PR doesn't address the Window case, as I can't test it. However, I think it is near identical.

diekhans avatar Nov 26 '23 07:11 diekhans

Thanks for the issue report and PR. I'm going to have to see if I can write a test case to test this on both windows and Linux.

Does this occur when running a (probably easier to test on a long process) and then killing exiftool process while results are coming back?

I'll see if I can run it through a few process dying tests.

sylikc avatar Nov 29 '23 02:11 sylikc

The hang happened when I sent something to exiftool that caused it throw an error. Unfortunately, I can't make that happen any more.

This seems like a very hard thing to write a test cases for. Timing based test cases are brittle. I just tried killing the exiftool process while it was waiting between request and didn't get it to hang.

Personally, I would make sure it doesn't break the non-error cases (it passed all the test) and then do a careful code review. Sometimes, it just isn't worth the time to write a hard test case for rare error.

Kevin M @.***> writes:

Thanks for the issue report and PR. I'm going to have to see if I can write a test case to test this on both windows and Linux.

Does this occur when running a (probably easier to test on a long process) and then killing exiftool process while results are coming back?

I'll see if I can run it through a few process dying tests.

-- Reply to this email directly or view it on GitHub: https://github.com/sylikc/pyexiftool/pull/81#issuecomment-1831114338 You are receiving this because you authored the thread.

Message ID: @.***>

diekhans avatar Nov 29 '23 03:11 diekhans