From 6f7f44b744a5831fe7a2daa2615e7bfafc5cd5e7 Mon Sep 17 00:00:00 2001 From: Diego Fronza Date: Mon, 6 Dec 2021 13:24:22 -0300 Subject: [PATCH] PG-286: Fix deadlock. Can't call elog() function from inside the pgsm_log as the pgss_hash lock could be already acquired in exclusive mode, since elog() triggers the psmg_emit_log hook, when it calls pgss_store it will try to acquire the pgss_hash lock again, leading to a deadlock. --- pgsm_errors.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/pgsm_errors.c b/pgsm_errors.c index 95f0197..878712a 100644 --- a/pgsm_errors.c +++ b/pgsm_errors.c @@ -96,9 +96,7 @@ void pgsm_log(PgsmLogSeverity severity, const char *format, ...) LWLockRelease(pgss->errors_lock); /* * We're out of memory, can't track this error message. - * In this case we must fallback to PostgreSQL log facility. */ - elog(WARNING, "pgsm_log_error: "); return; }