Bug
DeduplicationHandler::collectLogs() opens a file handle on line 145 but never closes it when flock() fails on line 151, leaking a file descriptor.
Version: 3.10.0
Code
DeduplicationHandler.php lines 145–152:
$handle = fopen($this->deduplicationStore, 'rw+');
if (false === $handle) {
throw new \RuntimeException('Failed to open file for reading and writing: ' . $this->deduplicationStore);
}
if (false === flock($handle, LOCK_EX)) {
return; // BUG: $handle is never closed
}
The happy path correctly calls fclose($handle) on line 172, but the early return on line 152 skips it.
Impact
Each failed flock() call leaks one file descriptor. In long-running processes (daemons, queue workers, etc.), this can accumulate and eventually exhaust the OS file descriptor limit.
Suggested fix
if (false === flock($handle, LOCK_EX)) {
fclose($handle);
return;
}
Bug
DeduplicationHandler::collectLogs()opens a file handle on line 145 but never closes it whenflock()fails on line 151, leaking a file descriptor.Version: 3.10.0
Code
DeduplicationHandler.phplines 145–152:The happy path correctly calls
fclose($handle)on line 172, but the early return on line 152 skips it.Impact
Each failed
flock()call leaks one file descriptor. In long-running processes (daemons, queue workers, etc.), this can accumulate and eventually exhaust the OS file descriptor limit.Suggested fix