ignore lock_file absense in release_shared_lock_file

It were ignored until f6e7be6d . Lets put that nuance back.

TODO: should find why we call `release_shared_lock_file` without lock held.
This commit is contained in:
Yura Sokolov
2022-12-05 20:32:04 +03:00
parent 573a0a9732
commit aa074cad26
+7 -1
View File
@@ -766,7 +766,13 @@ release_shared_lock_file(const char *backup_dir)
if (pids.len == 0)
{
ft_arr_pid_free(&pids);
if (remove(lock_file) != 0)
/*
* TODO: we should not call 'release_shared_lock_file' if we don't hold it.
* Therefore we should not ignore ENOENT.
* We should find why ENOENT happens, but until then lets ignore it as
* it were ignored for a while.
*/
if (remove(lock_file) != 0 && errno != ENOENT)
elog(ERROR, "Cannot remove shared lock file \"%s\": %s", lock_file, strerror(errno));
return;
}