[Postgres-xl-developers] Using killall in pgxc_ctl

Pavan Deolasee pavan.deolasee at gmail.com
Thu Jul 17 23:28:06 PDT 2014


Hello,

I think its a bad idea to use killall to terminate existing processes. I
noticed this for GTM, but the  same may apply to other kinds of processes
too. In my case, I was setting up GTM master and standby on the same
machine. pgxc_ctl was failing to start up GTM correctly. Upon
investigation, I figured out that while initialising/starting GTM slave, it
first kills any existing GTM processes using "killall gtm". This kills the
GTM master as well.

There are several issues with using killall

1. It may kill unrelated processes e.g. I'd a vim session on gtm_cmd.c and
it got killed too
2. It may kill processes belonging to another instance, if user is running
multiple database clusters on the same machine
3. killall -9 It doesn't do a clean shutdown which may cause issues

I wonder why can't we just rely on -m immediate? If the process fails to
respond to that, either we have a bug to fix or worst administrator can
manually kill the processes he wants. Even if we have to use kill command,
can we not read PID from the .pid file and send signal to that particular
process only?

Thanks,
Pavan

-- 
Pavan Deolasee
http://www.linkedin.com/in/pavandeolasee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.postgres-xl.org/private.cgi/postgres-xl-developers-postgres-xl.org/attachments/20140718/e5af45c1/attachment.htm>


More information about the Postgres-xl-developers mailing list