Re: [Glue] Deadlock bug

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Joel Jacobson <joel(at)gluefinance(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, glue(at)pgexperts(dot)com, Magnus Hagander <magnus(at)hagander(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [Glue] Deadlock bug
Date: 2010-08-20 18:55:03
Message-ID: AANLkTikcvVbjGizDTn8k7P6UVJMXdjR6iDxv1-zz89Dp@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Aug 20, 2010 at 7:38 PM, Joel Jacobson <joel(at)gluefinance(dot)com> wrote:
> If the locking logic would be modified to allow process 2 to go through, and
> instead abort process 1, I understand some other scenarios would of course
> be affected, where the situation would be handled in a less optimal way.

Which process dies when there's a deadlock is pretty much arbitary.
The first process to notice the deadlock will just throw an error
itself. Which one notices first depends on the timing of when the
blocking locks were taken.

If the second process to get stuck blocks before the first process
checks then the first process will notice first. If it does other
stuff first then the first process will check, not find a deadlock and
go back to sleep. Then the deadlock won't be detected until the second
process checks.

--
greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joel Jacobson 2010-08-20 18:57:39 Re: [Glue] Deadlock bug
Previous Message Magnus Hagander 2010-08-20 18:54:28 Re: git: uh-oh