Skip to content

Commit

Permalink
fix: Use gethostbyname() to resolve hosts using /etc/hosts alongside …
Browse files Browse the repository at this point in the history
…DNS resolving
  • Loading branch information
exaby73 authored and transistive committed Jun 26, 2024
1 parent b802e51 commit eb9674d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Neo4j/Neo4jConnectionPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ public function acquire(SessionConfiguration $config): Generator
$latestError = null;

if ($table == null) {
$addresses = $this->resolver->getAddresses((string) $this->data->getUri());
$addresses = (function () {
yield gethostbyname($this->data->getUri()->getHost());
yield from $this->resolver->getAddresses($this->data->getUri()->getHost());
})();
foreach ($addresses as $address) {
$triedAddresses[] = $address;
$pool = $this->createOrGetPool(Uri::create($address));
Expand Down

0 comments on commit eb9674d

Please sign in to comment.