| From: | Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> |
|---|---|
| To: | Heikki Linnakangas <hlinnaka(at)iki(dot)fi> |
| Cc: | pgsql-hackers(at)lists(dot)postgresql(dot)org, Andres Freund <andres(at)anarazel(dot)de>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com> |
| Subject: | Re: Interrupts vs signals |
| Date: | 2026-11-12 00:05:35 |
| Message-ID: | CAN4CZFOHfK1dpJijJwH4j8yMEHS5xier=9UAhB2BU_vWZ9x3qQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hello
An automated claude review pointed out an issue caused by 2e2751e6976:
it removed the SIGCHLD reset from PostgresMain(), but that code also
ran for standalone backends, which never call InitPostmasterChild().
postgres --single now keeps whatever SIGCHLD disposition it inherited,
and if that is SIG_IGN, pclose() fails:
$ python3 -c 'import os,signal,sys; signal.signal(signal.SIGCHLD,
signal.SIG_IGN); os.execvp(sys.argv[1], sys.argv[1:])' \
postgres --single -D data postgres
backend> COPY (SELECT 1) TO PROGRAM 'cat > /dev/null';
ERROR: could not close pipe to external command: No child processes
The attached patch adds the same reset to InitStandaloneProcess().
| Attachment | Content-Type | Size |
|---|---|---|
| v1-0001-Reset-SIGCHLD-in-standalone-backends-too.patch | text/x-patch | 1.4 KB |
| From | Date | Subject | |
|---|---|---|---|
| Previous Message | surya poondla | 2026-11-12 00:04:15 | Re: Partitioned index marked valid while a partition is pending detach |