Skip to content

Commit

Permalink
fix panic when fh_stat is undefined
Browse files Browse the repository at this point in the history
Signed-off-by: Utkarsh Srivastava <[email protected]>

await init semaphore

Signed-off-by: Utkarsh Srivastava <[email protected]>
  • Loading branch information
tangledbytes committed Nov 6, 2024
1 parent 81d6b8f commit 373b0df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util/persistent_logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 373b0df

Please sign in to comment.