CozySynthesizer / cozy

The collection synthesizer
https://cozy.uwplse.org
Apache License 2.0
209 stars 18 forks source link

Graceful interrupts #119

Closed Calvin-L closed 4 years ago

Calvin-L commented 4 years ago

Fixes #110.

This change is a bit more invasive than I was hoping for, but it definitely improves responsiveness. As an added benefit, Cozy performs a graceful stop on Ctrl+C instead of discarding its progress.

Calvin-L commented 4 years ago

GitHub isn't showing the Travis build status for some reason, but something in this change isn't working there. I'm going to set up a Linux environment to see if I can reproduce the failure.

Calvin-L commented 4 years ago

I'm able to reproduce the failure, but it happens on master as well as this branch. There's a segfault happening somewhere; dmesg reports:

[ 4969.897438] cozy[5274]: segfault at 0 ip 00007f8f339a3830 sp 00007ffdd6047460 error 4 in libffi.so.6.0.2[7f8f3399f000+5000]
[ 4969.897447] Code: ff ff 48 89 c7 48 8d 04 c1 48 8b 4d 88 01 f7 4a 89 04 e9 89 7d 84 49 83 c5 01 4c 39 6d 90 74 69 66 2e 0f 1f 84 00 00 00 00 00 <4b> 8b 3c ec 31 d2 4c 89 f1 4c 89 fe 4c 89 45 98 e8 eb f5 ff ff 4c

My current guess is that the newest version of one of Cozy's dependencies is somehow broken. Hopefully adjusting requirements.txt is all it will take to fix this...

Calvin-L commented 4 years ago

The segfaults in Travis are unrelated to this change. I have opened #120 to track progress fixing the segfaults, and I'm putting this on hold until that's done.

Calvin-L commented 4 years ago

It turns out there were segfaults happening on both master and this branch, but for different reasons. The segfaults on master are still unexplained, but the segfaults on this branch were due to misuse of multiprocessing.Value. I have fixed this branch in 237d047. Merging this branch will fix the segfaults on master: those seem due to fork() and this change moves us away from fork().

Calvin-L commented 4 years ago

(@izgzhen I will merge this tomorrow unless you have additional feedback.)

izgzhen commented 4 years ago

It looks great to me!