AmesCornish / buttersink

Buttersink is like rsync for btrfs snapshots
GNU General Public License v3.0
195 stars 18 forks source link

Catch interrupt signal #33

Closed NicoHood closed 8 years ago

NicoHood commented 8 years ago

If you press Ctrl+C while transfering data you get python errors:

  Xfer: 138e...0423 /.snapshots/37/snapshot from f84d...a4db /.snapshots/40/snapshot (~3.033 MiB)
^C:11:03.480866: Sent 1.719 GiB of 3.033 MiB (58029%) ETA: None (22.3 Mbps )                     
  btrfs receive errors
Traceback (most recent call last):
  File "/usr/bin/buttersink", line 11, in <module>
    load_entry_point('buttersink==0.6.8', 'console_scripts', 'buttersink')()
  File "/usr/lib/python2.7/site-packages/buttersink/buttersink.py", line 257, in main
    diff.sendTo(dest, chunkSize=args.part_size << 20)
  File "/usr/lib/python2.7/site-packages/buttersink/Store.py", line 354, in sendTo
    transfer(sendContext, receiveContext, chunkSize)
  File "/usr/lib/python2.7/site-packages/buttersink/Store.py", line 276, in transfer
    writer.write(data)
KeyboardInterrupt
AmesCornish commented 8 years ago

This behavior is currently by design. When you press Ctrl+C, buttersink shows you where it was in the execution stack, which can be helpful in diagnosing hangs or other problems. The only error is "KeyboardInterrupt", which means you pressed Ctrl+C.