Skip to content

Commit

Permalink
fix: dont aquire exclusive locks (#4340)
Browse files Browse the repository at this point in the history
Due to bugs in logging/error-handling there sometimes are deadlocks
  • Loading branch information
dvikan authored Nov 23, 2024
1 parent e3260ff commit 628b302
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion caches/FileCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function set($key, $value, int $ttl = null): void
'value' => $value,
];
$cacheFile = $this->createCacheFile($key);
$bytes = file_put_contents($cacheFile, serialize($item), LOCK_EX);
$bytes = file_put_contents($cacheFile, serialize($item));
// todo: Consider tightening the permissions of the created file. It usually allow others to read, depending on umask
if ($bytes === false) {
// Consider just logging the error here
Expand Down
2 changes: 1 addition & 1 deletion lib/logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public function __invoke(array $record)
$record['message'],
$context
);
$bytes = file_put_contents($this->stream, $text, FILE_APPEND | LOCK_EX);
$bytes = file_put_contents($this->stream, $text, FILE_APPEND);
}
}

Expand Down

0 comments on commit 628b302

Please sign in to comment.