Skip to content

Commit cabece8

Browse files
committed
[3.x] Only close existing runtimes
There is a small race condition when closing threads, this isn't much of an issue as runtimes only get closed after a certain time when inactive or right after completing a task. This check ensures we don't try to close and non-existing runtimes.
1 parent 6826af3 commit cabece8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Infinite.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ private function startTtlTimer(Runtime $runtime): void
194194

195195
private function closeRuntime(int $id): void
196196
{
197+
if (! array_key_exists($id, $this->runtimes)) {
198+
return;
199+
}
200+
197201
// check if it exists
198202
$runtime = $this->runtimes[$id];
199203
try {

0 commit comments

Comments
 (0)