Re: Perl script is killed by SIGPIPE

From: Yogesh Sharma <yogeshraj95(at)gmail(dot)com>
To: Daniel Verite <daniel(at)manitou-mail(dot)org>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Perl script is killed by SIGPIPE
Date: 2017-09-13 05:34:32
Message-ID: CAEZUwCRUPUYkOtHSVLw4OfeLUegOCNv9NXAYKRzPvVgP5Zy5Fg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear Daniel,
Yes , we are using DBI for connection.

Basically we observed that after dbh->do() return nothing if we are trying
to insert duplicate entry.
But it is not occurred always.
It return exit 1 if try to insert duplicate entry into Db.
But sometime it return nothing and child script is killed.

On Tuesday, September 12, 2017, Daniel Verite <daniel(at)manitou-mail(dot)org>
wrote:

> 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
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Frank Millman 2017-09-13 07:18:47 Re: Joining 16 tables seems slow
Previous Message Hung Phan 2017-09-13 05:21:14 Re: pg_rewind copy so much data