Skip to content
Snippets Groups Projects
Commit f339d7f8 authored by Stephen R. van den Berg's avatar Stephen R. van den Berg
Browse files

pgsql: Kludge around clone race in Pike core.

As reported by Jeff Hungerford:

When there is:
- No connection at present.
- Two or more threads try to open an initial connection to the database
  simultaneously.

You can trigger this:

Attempting to clone an unfinished program
/usr/local/pike/8.0.175/lib/modules/Sql.pmod/Sql.pike:342:
    Sql.Sql()->create("localhost:5432","foo","bar","CENSORED",UNDEFINED)

This could be caused by a race in the Pike-core class-cloning code which
is not racefree when two threads try to instantiate the same object
at roughly the same instant.

This patch attempts a workaround to detect the race and loop until
it finishes without problems.  It would be better if this could be
fixed in the Pike-core.
parent d483c054
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment