Re: [HACKERS] Trouble in paradise: cancel via postmaster ain't so cool

From: "Henry B(dot) Hotz" <hotz(at)jpl(dot)nasa(dot)gov>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Trouble in paradise: cancel via postmaster ain't so cool
Date: 1998-07-08 00:04:03
Message-ID: v03130313b1c86614c6b4@[137.78.218.94]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 3:46 PM -0700 7/7/98, Tom Lane wrote:
>I can see several alternatives, none very attractive:
>
>1. Try to code the new PQrequestCancel so that it doesn't invoke
>any likely-non-reentrant part of the C library. Difficult at best,
>maybe impossible (is gethostbyname reentrant? I doubt it if malloc
>isn't).
...

>I will work on #1 but I am not very hopeful of success. Has anyone
>got a better idea?

Idea A: precompute everything you need to do a cancel as part of sending
the request in the first place so #1 above takes minimum effort (i.e. no
malloc(), no gethostbyname(), no nothing).

Idea B: spawn (vfork()/exec()) a cancel process so all the funny stuff
happens in a different address space.

Idea C: look at what some standard network clients do to handle similar
problems. What does ftp do for example? It also seems like some network
programming textbooks, like Stevens, should discuss this problem.

Signature failed Preliminary Design Review.
Feasibility of a new signature is currently being evaluated.
h(dot)b(dot)hotz(at)jpl(dot)nasa(dot)gov, or hbhotz(at)oxy(dot)edu

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas G. Lockhart 1998-07-08 01:39:23 Re: [HACKERS] Re: [BUGS] Small bug in union
Previous Message Tom Lane 1998-07-07 23:04:51 Re: [HACKERS] Re: [BUGS] Small bug in union