From 373b0dff7d5fd60d56f52d5f20fb4740f8b35dad Mon Sep 17 00:00:00 2001 From: Utkarsh Srivastava Date: Thu, 7 Nov 2024 00:03:49 +0530 Subject: [PATCH] fix panic when fh_stat is undefined Signed-off-by: Utkarsh Srivastava await init semaphore Signed-off-by: Utkarsh Srivastava --- src/util/persistent_logger.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/persistent_logger.js b/src/util/persistent_logger.js index 333ea32c82..7f49354f42 100644 --- a/src/util/persistent_logger.js +++ b/src/util/persistent_logger.js @@ -232,9 +232,9 @@ class PersistentLogger { // Don't race with init process - Can happen if arogue/misconfigured // process is continuously moving the active file - this.init_lock.surround(async () => { + await this.init_lock.surround(async () => { // If the file has changed, re-init - if (stat.ino !== this.fh_stat.ino) { + if (this.fh_stat && stat.ino !== this.fh_stat.ino) { dbg.log1('active file changed, closing for namespace:', this.namespace); await this.close(); }