Re: [BUGS] Win32 deadlock detection not working for Postgres8beta1

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Steve McWilliams" <smcwilliams(at)EmprisaNetworks(dot)com>
Cc: <pgsql-bugs(at)postgresql(dot)org>, <pgsql-hackers-win32(at)postgresql(dot)org>, "PostgreSQL-patches" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [BUGS] Win32 deadlock detection not working for Postgres8beta1
Date: 2004-09-02 18:40:34
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCE475BB4@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers-win32 pgsql-patches

>> I am just starting to test out Postgres8 beta1 and notice that the
>> deadlock detection mechanism is not working (under windows
>XP pro with
>> service pack 1). I am using the version of Postgres built by the
>> PGFoundry project, and have it installed as a service.
>
>> To produce the bug I simply launch 2 separate psql windows, begin a
>> transaction in each, then do staggered 'SELECT ... FOR
>UPDATE' calls on 2
>> different rows in each of the psql windows, in reverse
>order. The two
>> processes will hang indefinitely.
>
>> The deadlock detection for 8beta1 seems to work fine under
>linux btw. I
>> have not tried this using a version of 8beta1 built using
>cygwin, but I
>> have run versin 7.4 under cygwin before without this problem.
>
>A reasonable theory about this would be that the timer interrupt isn't
>firing. Does "statement_timeout" work either?

Bugger. I've found the reason for this - statement_timeout was also
broken. This was broken by the change of how signals are handled on
win32. We disabled APCs completely, but APCs were still used in the
timer emulation... This patch fixes this by re-enabling APCs in the main
check loop. The APC routine used by the timer code is very simple and
will not interfer with the signal stuff (which had problems with socket
calls, as you probably recall).

//Magnus

Attachment Content-Type Size
win32_timer.patch application/octet-stream 814 bytes

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2004-09-02 19:07:22 Re: [pgsql-hackers-win32] Win32 deadlock detection not working for Postgres8beta1
Previous Message Steve McWilliams 2004-09-02 16:12:23 Re: Win32 deadlock detection not working for Postgres8beta1

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Magnus Hagander 2004-09-02 18:51:07 Re: [BUGS] Win32 deadlock detection not working for Postgres8beta1
Previous Message Magnus Hagander 2004-09-02 18:38:06 Re: Compiling beta2 with openssl on XP Pro

Browse pgsql-patches by date

  From Date Subject
Next Message Magnus Hagander 2004-09-02 18:51:07 Re: [BUGS] Win32 deadlock detection not working for Postgres8beta1
Previous Message Tom Lane 2004-09-02 17:59:00 Re: Typo in initdb.c