Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progressbar signal handler for SIGWINCH causes system calls to be interrupted #30

Open
GoogleCodeExporter opened this issue Nov 16, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?

1. Install the latest version of euca2ools 3.0.0 available here: 
https://github.com/eucalyptus/euca2ools/tree/requestbuilder
2. Use the euca-bundle-vol tool (which uses progressbar)
3. Attempt to resize the terminal window during tarball bundling

What is the expected output? What do you see instead?

I expect to see the progressbar resized properly, but instead an IOError 
exception is raised with EINTR, since the write system call is being 
interrupted by the signal handler for SIGWINCH.

Here's the exception output below:

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done 

tune2fs 1.42.3 (14-May-2012)
  done
Syncing volume contents...  done
euca-bundle-vol: error: Interrupted system call                                 
Exception in thread Thread-2:                     | 718.55 MB  35.40 MB/s ETA:  
Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib64/python2.7/threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.7/site-packages/euca2ools-3.0.0_alpha6-py2.7.egg/euca2ools/commands/bundle/bundle.py", line 187, in _add_fileobj_to_tarball
    tarball.close()
  File "/usr/lib64/python2.7/tarfile.py", line 1776, in close
    self.fileobj.write(NUL * (BLOCKSIZE * 2))
  File "/usr/lib64/python2.7/tarfile.py", line 471, in write
    self.__write(s)
  File "/usr/lib64/python2.7/tarfile.py", line 479, in __write
    self.fileobj.write(self.buf[:self.bufsize])
IOError: [Errno 32] Broken pipe

Exception IOError: (32, 'Broken pipe') in <bound method _Stream.__del__ of 
<tarfile._Stream instance at 0x29673f8>> ignored
Bundling image 100% |======================|  10.00 GB 503.30 MB/s Time: 0:00:21
euca-bundle-vol: error: 
[root@i euca2ools]# 


What version of the product are you using? On what operating system?

I'm using progressbar 0.9.8 on CentOS 6.4

Please provide any additional information below.

I've attached a patch that fixes the issue. After installing the signal 
handler, progressbar should then set the SA_RESTART flag so that system calls 
are restarted after the signal handler executes.

Original issue reported on code.google.com by mspauldi...@gmail.com on 16 May 2013 at 4:46

Attachments:

@GoogleCodeExporter
Copy link
Author

The version I mentioned in the ticket is actually wrong. I'm using progressbar 
2.3.

Original comment by mspauldi...@gmail.com on 16 May 2013 at 5:00

@GoogleCodeExporter
Copy link
Author

This affects me as well. Is there a problem with the patch?

Original comment by andrefcruz on 22 Jan 2014 at 10:43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant