pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Teach pg_ls_dir_files() to ignore ENOENT failures from stat(). 4+ messages / 1 participants [nested] [flat]
* pgsql: Teach pg_ls_dir_files() to ignore ENOENT failures from stat(). @ 2020-03-31 16:58 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2020-03-31 16:58 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Teach pg_ls_dir_files() to ignore ENOENT failures from stat(). Buildfarm experience shows that this function can fail with ENOENT if some other process unlinks a file between when we read the directory entry and when we try to stat() it. The problem is old but we had not noticed it until 085b6b667 added regression test coverage. To fix, just ignore ENOENT failures. There is one other case that this might hide: a symlink that points to nowhere. That seems okay though, at least better than erroring. Back-patch to v10 where this function was added, since the regression test cases were too. Discussion: https://postgr.es/m/20200308173103.GC1357@telsasoft.com Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ee40e8975e2cd2811d14a35ce9179bd46e1f59f2 Modified Files -------------- src/backend/utils/adt/genfile.c | 5 +++++ 1 file changed, 5 insertions(+) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Teach pg_ls_dir_files() to ignore ENOENT failures from stat(). @ 2020-03-31 16:58 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2020-03-31 16:58 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Teach pg_ls_dir_files() to ignore ENOENT failures from stat(). Buildfarm experience shows that this function can fail with ENOENT if some other process unlinks a file between when we read the directory entry and when we try to stat() it. The problem is old but we had not noticed it until 085b6b667 added regression test coverage. To fix, just ignore ENOENT failures. There is one other case that this might hide: a symlink that points to nowhere. That seems okay though, at least better than erroring. Back-patch to v10 where this function was added, since the regression test cases were too. Discussion: https://postgr.es/m/20200308173103.GC1357@telsasoft.com Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/83f7761d84e6b9879decd223b0e172afcb1426d8 Modified Files -------------- src/backend/utils/adt/genfile.c | 5 +++++ 1 file changed, 5 insertions(+) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Teach pg_ls_dir_files() to ignore ENOENT failures from stat(). @ 2020-03-31 16:58 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2020-03-31 16:58 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Teach pg_ls_dir_files() to ignore ENOENT failures from stat(). Buildfarm experience shows that this function can fail with ENOENT if some other process unlinks a file between when we read the directory entry and when we try to stat() it. The problem is old but we had not noticed it until 085b6b667 added regression test coverage. To fix, just ignore ENOENT failures. There is one other case that this might hide: a symlink that points to nowhere. That seems okay though, at least better than erroring. Back-patch to v10 where this function was added, since the regression test cases were too. Discussion: https://postgr.es/m/20200308173103.GC1357@telsasoft.com Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/5b22ff764b0f60c24d89ec0180476cda361ec126 Modified Files -------------- src/backend/utils/adt/genfile.c | 5 +++++ 1 file changed, 5 insertions(+) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Teach pg_ls_dir_files() to ignore ENOENT failures from stat(). @ 2020-03-31 16:58 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2020-03-31 16:58 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Teach pg_ls_dir_files() to ignore ENOENT failures from stat(). Buildfarm experience shows that this function can fail with ENOENT if some other process unlinks a file between when we read the directory entry and when we try to stat() it. The problem is old but we had not noticed it until 085b6b667 added regression test coverage. To fix, just ignore ENOENT failures. There is one other case that this might hide: a symlink that points to nowhere. That seems okay though, at least better than erroring. Back-patch to v10 where this function was added, since the regression test cases were too. Discussion: https://postgr.es/m/20200308173103.GC1357@telsasoft.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/82e801852274e46492b0e160624a850157c677e4 Modified Files -------------- src/backend/utils/adt/genfile.c | 5 +++++ 1 file changed, 5 insertions(+) ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2020-03-31 16:58 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-03-31 16:58 pgsql: Teach pg_ls_dir_files() to ignore ENOENT failures from stat(). Tom Lane <tgl@sss.pgh.pa.us> 2020-03-31 16:58 pgsql: Teach pg_ls_dir_files() to ignore ENOENT failures from stat(). Tom Lane <tgl@sss.pgh.pa.us> 2020-03-31 16:58 pgsql: Teach pg_ls_dir_files() to ignore ENOENT failures from stat(). Tom Lane <tgl@sss.pgh.pa.us> 2020-03-31 16:58 pgsql: Teach pg_ls_dir_files() to ignore ENOENT failures from stat(). Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox