pg_ctl {start,restart,reload} bad handling of stdout file descriptor

From: Luis Menina <lmenina(at)anevia(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: pg_ctl {start,restart,reload} bad handling of stdout file descriptor
Date: 2014-12-30 15:37:28
Message-ID: CAC4O4H-xHChwKuKdN15SruDHxf7gQ7aNJ598_1FwtAYWPiv1oA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I've been trying to run some pg_ctl command inside a python script,
and saw that some of them where deadlocking. It seems that the
commands that start postgres handle stdout in a way that that block
the caller. Redirecting stdout to /dev/null or to a file using the -l
option allow me to workaround the problem, but fixing it upstream
would be nice.

Here's a simple python program that reproduces the problem, and should deadlock.
Customize your data path first, of course.

Regards,
--
Luis MENINA / Software Engineer
Web: www.anevia.com
Anevia: 1 rue René Anjolvy, 94250 Gentilly, France

Attachment Content-Type Size
pg_ctl-deadlock.py text/x-python 690 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Luis Menina 2014-12-30 15:42:19 Re: pg_ctl {start, restart, reload} bad handling of stdout file descriptor
Previous Message Alexey Vasiliev 2014-12-30 15:22:29 Re[2]: [HACKERS] Patch: add recovery_timeout option to control timeout of restore_command nonzero status code