Re: [GENERAL] Perl script is killed by SIGPIPE - Mailing list pgsql-general

From Daniel Verite
Subject Re: [GENERAL] Perl script is killed by SIGPIPE
Date
Msg-id 985069ea-f204-4b7a-ba20-544923c0d458@manitou-mail.org
Whole thread Raw
In response to [GENERAL] Perl script is killed by SIGPIPE  (Yogesh Sharma <yogeshraj95@gmail.com>)
Responses Re: [GENERAL] Perl script is killed by SIGPIPE  (Yogesh Sharma <yogeshraj95@gmail.com>)
List pgsql-general
    Yogesh Sharma wrote:

> We have found child script is killed by signal 13 SIGPIPE. When duplicate
> key violates error occured, script is killed but not all time.

"child script" and this kind of error suggests that a forked process
inherits a database connection opened by a parent process.

When the database handle goes out of scope, it might
close the connection to the database, affecting the
parent process too, since it's the same connection.

If you're using DBI, it has a setting to avoid that issue:
https://metacpan.org/pod/DBI#InactiveDestroy

Aside from that, inherited connections can't be used
simultaneously by parent and child process.
In general, a child process should open and close
its own connection.

Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: "Frank Millman"
Date:
Subject: Re: [GENERAL] Joining 16 tables seems slow
Next
From: Chris Travers
Date:
Subject: Re: [GENERAL] Joining 16 tables seems slow