pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alexander Kukushkin <cyberdemn@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Re: BUG #8647: Backend process hangs and becomes unkillable when SSL client looses connection
Date: Thu, 05 Dec 2013 09:54:38 -0500
Message-ID: <15044.1386255278@sss.pgh.pa.us> (raw)
In-Reply-To: <CAFh8B=n84eWSmvau3ETL0OMUfrHag9Rotmc2AzizqaZBpQsLZg@mail.gmail.com>
References: <CAFh8B=n84eWSmvau3ETL0OMUfrHag9Rotmc2AzizqaZBpQsLZg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Alexander Kukushkin <cyberdemn@gmail.com> writes:
> After analysing source code of postgres and openssl I've found (at least I
> think) the reason why it is happening:
> ----------------------------------------------------------------------------------------------------------------------------
> static int
> my_sock_write(BIO *h, const char *buf, int size)
> {
>         int                     res = 0;

>         res = send(h->num, buf, size, 0);
>         if (res <= 0)
>         {
>                 if (errno == EINTR)
>                 {
>                         BIO_set_retry_write(h);
>                 }
>         }

>         return res;
> }

BTW, I was looking at that function the other day and thinking it was
wrong: if the send() returns exactly zero, it hasn't set errno has it?
But perhaps that case never arises.

			regards, tom lane


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



view thread (6+ messages)  latest in thread

Message-ID: <15044.1386255278@sss.pgh.pa.us>
Permalink:  ../15044.1386255278@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/15044.1386255278@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, cyberdemn@gmail.com
  Subject: Re: BUG #8647: Backend process hangs and becomes unkillable when SSL client looses connection
  In-Reply-To: <15044.1386255278@sss.pgh.pa.us>
  References: <CAFh8B=n84eWSmvau3ETL0OMUfrHag9Rotmc2AzizqaZBpQsLZg@mail.gmail.com> <15044.1386255278@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox