Skip site navigation (1) Skip section navigation (2)

Re: Minor fix in lwlock.c

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Minor fix in lwlock.c
Date: 2005-04-08 06:39:15
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
"Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu> writes:
> "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes
>> Maybe we *should* make it a PANIC.  Thoughts?

> Reasonable. Since this should *never* happen. Once happened, that's means we
> have a serious bug in our design/coding.

Plan C would be something like

	if (num_held_lwlocks >= MAX_SIMUL_LWLOCKS)
		release the acquired lock;
		elog(ERROR, "too many LWLocks taken");

But we couldn't just call LWLockRelease, since it expects the lock to
be recorded in held_lwlocks[].  We'd have to duplicate a lot of code,
or split LWLockRelease into multiple routines, neither of which seem
attractive answers considering that this must be a can't-happen
case anyway.

PANIC it will be, unless someone thinks of a reason why not by

			regards, tom lane

In response to


pgsql-patches by date

Next:From: Qingqing ZhouDate: 2005-04-08 07:58:52
Subject: Re: Minor fix in lwlock.c
Previous:From: Qingqing ZhouDate: 2005-04-08 06:02:50
Subject: Re: Minor fix in lwlock.c

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group