On Mon, Oct 19, 2015 at 8:28 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Alvaro Herrera <alvherre@2ndquadrant.com> writes: > Jeff Janes wrote: >> I've added the TODO item: >> >> When pg_upgrade -j ... is interrupted (for example, ctrl-C from the >> keyboard) make it cancel the children processes. >> >> The context where this arises is that I want to populate data into a new >> installation compiled with a patch under review, but immediately get error >> messages indicating I forgot to install a required extension. I hit ctrl-C >> so I can fix the problem, but it keeps running anyway.
> This looks more like a bug to me than a To-do item.
Why doesn't the control-C kill all the child processes automatically? I'd have expected it to ...
It seems like gdb eats signals that you send a process while it is being debugged, so it is hard to figure out what is going on. From strace, it looks like the children do receive a signal but either ignore it, or set a flag and then ignore that.
It doesn't continue to load the entire dump file, it exits once they complete the current assignment and ask the parent for more work.
Could just be a matter of adding the local equivalent of CHECK_FOR_INTERRUPTS in the part of the code that spools COPY data to the backends? I'm not sure what would happen if it were in the index/constraint building phase, I've never let it get that far when it reported errors early on.