Re: [PATCH] Fix memory leak of reply_message in walreceiver
Вложения
В списке pgsql-hackers по дате отправления:
| От | Michael Paquier |
|---|---|
| Тема | Re: [PATCH] Fix memory leak of reply_message in walreceiver |
| Дата | |
| Msg-id | ae6xymlfUepxsT6n@paquier.xyz обсуждение |
| Ответ на | [PATCH] Fix memory leak of reply_message in walreceiver (DaeMyung Kang <charsyam@gmail.com>) |
| Список | pgsql-hackers |
On Mon, Apr 27, 2026 at 01:59:09AM +0900, DaeMyung Kang wrote:
> initStringInfo() unconditionally allocates a fresh ~1KB buffer with
> palloc() and overwrites the existing data pointer without freeing the
> previous one. So every time the walreceiver re-enters the streaming
> path -- e.g., after a timeline switch, end-of-WAL, or any other
> condition that drives the outer for(;;) loop to iterate -- the prior
> buffer is leaked. The leak is bounded per streaming restart but
> accumulates over the lifetime of a long-running standby that
> restarts streaming often.
This is a problem similar to [1], and I'd agree about cleaning that up
properly.
> This appears to date back to commit add6c3179a4 ("Make the streaming
> replication protocol messages architecture-independent.", 2012), so
> the fix is likely a candidate for back-patching to all supported
> branches.
This is minor, so I don't really see a point in back-patching. Same
reason as the other thread.
I'll go merge that together.
[1]: https://www.postgresql.org/message-id/ae6vp9L-GUb0ERTF@paquier.xyz
--
Michael
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера