aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2019-12-21 17:39:36 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2019-12-21 17:39:36 -0500
commit5406513e997f5ee9de79d4076ae91c04af0c52f6 (patch)
tree11b49f1209dcd430ca50c9d7d66e3a82603b5522 /src/backend/access/gist
parent4376fdbae11de9333012a31ba8d3a4f4b5d7a692 (diff)
downloadpostgresql-5406513e997f5ee9de79d4076ae91c04af0c52f6.tar.gz
postgresql-5406513e997f5ee9de79d4076ae91c04af0c52f6.zip
In pgwin32_open, loop after ERROR_ACCESS_DENIED only if we can't stat.
This fixes a performance problem introduced by commit 6d7547c21. ERROR_ACCESS_DENIED is returned in some other cases besides the delete-pending case considered by that commit; notably, if the given path names a directory instead of a plain file. In that case we'll uselessly loop for 1 second before returning the failure condition. That slows down some usage scenarios enough to cause test timeout failures on our Windows buildfarm critters. To fix, try to stat() the file, and sleep/loop only if that fails. It will fail in the delete-pending case, and also in the case where the deletion completed before we could stat(), so we have the cases where we want to loop covered. In the directory case, the stat() should succeed, letting us exit without a wait. One case where we'll still wait uselessly is if the access-denied problem pertains to a directory in the given pathname. But we don't expect that to happen in any performance-critical code path. There might be room to refine this further, but I'll push it now in hopes of making the buildfarm green again. Back-patch, like the preceding commit. Alexander Lakhin and Tom Lane Discussion: https://postgr.es/m/23073.1576626626@sss.pgh.pa.us
Diffstat (limited to 'src/backend/access/gist')
0 files changed, 0 insertions, 0 deletions