Re: [EXTERNAL] Support load balancing in libpq

Поиск
Список
Период
Сортировка
От Aleksander Alekseev
Тема Re: [EXTERNAL] Support load balancing in libpq
Дата
Msg-id CAJ7c6TO8Dg3ZvpPpP9G5_gmnR8KmzPpJyBwsMx9Zaky84=zS6Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [EXTERNAL] Support load balancing in libpq  (Daniel Gustafsson <daniel@yesql.se>)
Ответы Re: [EXTERNAL] Support load balancing in libpq  (Aleksander Alekseev <aleksander@timescale.com>)
Список pgsql-hackers
Hi,

> > ▶ 6/6 - received at least one connection on node1       OK
> > ▶ 6/6 - received at least one connection on node2       OK
> > ▶ 6/6 - received at least one connection on node3       OK
> > ▶ 6/6 - received 50 connections across all nodes        OK
>
> Good point.
>
> > Finally, I changed a few small typos in your updated commit message
> > (some of which originated from my earlier commit messages)
>
> +1

Hi,

> I would like to see this wrapped up in the current CF, what do you think about
> the attached?

In v15-0001:

```
+    conn->addr = calloc(conn->naddr, sizeof(AddrInfo));
+    if (conn->addr == NULL)
+    {
+        libpq_append_conn_error(conn, "out of memory");
+        return 1;
+    }
```

According to the man pages, in a corner case when naddr is 0 calloc
can return NULL which will not indicate an error.

So I think it should be:

```
if (conn->addr == NULL && conn->naddr != 0)
```

Other than that v15 looked very good. It was checked on Linux and
MacOS including running it under sanitizer.

I will take a look at v16 now.

--
Best regards,
Aleksander Alekseev



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Daniel Gustafsson
Дата:
Сообщение: Re: [EXTERNAL] Support load balancing in libpq
Следующее
От: Dagfinn Ilmari Mannsåker
Дата:
Сообщение: Re: MacOS: xsltproc fails with "warning: failed to load external entity"