Skip to content

Commit

Permalink
fix: clear Client::autoCloseable on close
Browse files Browse the repository at this point in the history
The autoCloseable list of a client is only growing but is never cleared.
This causes problems with the reference based garbage collection. But there
is nothing more to process when all writers were closed.

This problem can often be seen on a system that each call of
client->createWriteApi (on the same "global" client) followed by a
->write() will leak one or more file descriptor(s).
  • Loading branch information
ecsv committed Sep 27, 2021
1 parent 217bed4 commit 5f91992
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/InfluxDB2/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ public function close()
foreach ($this->autoCloseable as $ac) {
$ac->close();
}
$this->autoCloseable = [];
}

public function getConfiguration()
Expand Down

0 comments on commit 5f91992

Please sign in to comment.