Magnus Hagander <magnus(at)hagander(dot)net> writes:
> Passes my tests, but I can't really reproduce the requirement to retry,
> so I haven't been able to test that part :(
The patch looks sane to me. If you want to test, perhaps reducing the
sleep to 1 msec or so would reproduce the need to go around the loop
more than once. (Don't forget to put the machine under additional
load, too.)
regards, tom lane