~josvaz/ubuntu-on-ec2/ec2-publishing-scripts-lp1613470-udev-cdrom

Viewing all changes in revision 411.

  • Committer: Scott Moser
  • Date: 2012-02-06 19:51:54 UTC
  • Revision ID: smoser@ubuntu.com-20120206195154-d1j0mw2vpnuqxjp1
better handle cleaning up of instances in failed publish-build-ebs

publish-build-ebs was "leaking instances" when one of the builds failed.

The primary problem was that the previous code expected that 
a subshell's signal handlers were inherited from their parent.  That is
simply not true.

The changes here primarily address that, but also address general
signal handing of the SIGINT and SIGTERM.

Note, that in publish-build-ebs, we still wait for each region to finish
serially.  That  means that if we're publishing in the following order:
 us-east-1 
 us-west-1
 ap-northeast-1
 sa-east-1

and ap-northeast-1 fails immediately, we'll continue on blissfully until
both us-east-1 and us-west-1 finish.  At that point, it will recognize
that ap-northeast-1 has failed, and kill any jobs (possibly sa-east-1)
that are still running.

The potential fix for that would be to add a signal handler for SIGCHLD
and then somehow check its return code and trigger cleanup code then.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: