aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gistget.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-01-05 19:42:49 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2018-01-05 19:42:49 -0500
commit83fe2708d66889ed9ef6bdb922d27bba4b0d4f81 (patch)
tree9c848b932c0fe7fb1092812be7425b7b0c0e678f /src/backend/access/gist/gistget.c
parent1c77e990833a72039a71ca3f813ff6d05a4d09b9 (diff)
downloadpostgresql-83fe2708d66889ed9ef6bdb922d27bba4b0d4f81.tar.gz
postgresql-83fe2708d66889ed9ef6bdb922d27bba4b0d4f81.zip
Reorder steps in ConditionVariablePrepareToSleep for more safety.
In the admittedly-very-unlikely case that AddWaitEventToSet fails, ConditionVariablePrepareToSleep would error out after already having set cv_sleep_target, which is probably bad, and after having already set cv_wait_event_set, which is very bad. Transaction abort might or might not clean up cv_sleep_target properly; but there is nothing that would be aware that the WaitEventSet wasn't fully constructed, so that all future condition variable sleeps would be broken. We can easily guard against these hazards with slight restructuring. Back-patch to v10 where condition_variable.c was introduced. Discussion: https://postgr.es/m/CAEepm=0NWKehYw7NDoUSf8juuKOPRnCyY3vuaSvhrEWsOTAa3w@mail.gmail.com
Diffstat (limited to 'src/backend/access/gist/gistget.c')
0 files changed, 0 insertions, 0 deletions