pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: pg_receivewal: Fix resource leaks and error reporting during cle
6+ messages / 1 participants
[nested] [flat]

* pgsql: pg_receivewal: Fix resource leaks and error reporting during cle
@ 2026-11-20 11:31  Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2026-11-20 11:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pg_receivewal: Fix resource leaks and error reporting during cleanup

Failures while finalizing LZ4 compression or writing the final compressed
data could leak a file descriptor and memory. Without --no-loop,
repeated failures across reconnects could accumulate these resources.

This happened because dir_close() returned immediately on these failures,
skipping the code that closes the file and releases its associated
resources. Fix this by closing the file and executing the common cleanup
code before returning.

Backpatch to all supported versions.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Xuneng Zhou <xunengzhou@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwHfCrEogr6=wr0nCkQevAJ9A3HBqQRjT9iJryO7EjF6Lw@mail.gmail.com
Backpatch-through: 15

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0cb41ee8070fb0930d2ead13e19304d11d405636

Modified Files
--------------
src/bin/pg_basebackup/receivelog.c | 13 ++++++++++---
src/bin/pg_basebackup/walmethods.c |  9 ++++++---
2 files changed, 16 insertions(+), 6 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: pg_receivewal: Fix resource leaks and error reporting during cle
@ 2026-11-20 11:31  Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2026-11-20 11:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pg_receivewal: Fix resource leaks and error reporting during cleanup

Failures while finalizing LZ4 compression or writing the final compressed
data could leak a file descriptor and memory. Without --no-loop,
repeated failures across reconnects could accumulate these resources.

This happened because dir_close() returned immediately on these failures,
skipping the code that closes the file and releases its associated
resources. Fix this by closing the file and executing the common cleanup
code before returning.

Backpatch to all supported versions.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Xuneng Zhou <xunengzhou@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwHfCrEogr6=wr0nCkQevAJ9A3HBqQRjT9iJryO7EjF6Lw@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f6abd575d605f1620626073e292f15057c3e0ca1

Modified Files
--------------
src/bin/pg_basebackup/receivelog.c | 13 ++++++++++---
src/bin/pg_basebackup/walmethods.c |  9 ++++++---
2 files changed, 16 insertions(+), 6 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: pg_receivewal: Fix resource leaks and error reporting during cle
@ 2026-11-20 11:31  Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2026-11-20 11:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pg_receivewal: Fix resource leaks and error reporting during cleanup

Failures while finalizing LZ4 compression or writing the final compressed
data could leak a file descriptor and memory. Without --no-loop,
repeated failures across reconnects could accumulate these resources.

This happened because dir_close() returned immediately on these failures,
skipping the code that closes the file and releases its associated
resources. Fix this by closing the file and executing the common cleanup
code before returning.

Backpatch to all supported versions.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Xuneng Zhou <xunengzhou@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwHfCrEogr6=wr0nCkQevAJ9A3HBqQRjT9iJryO7EjF6Lw@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fd900b76b13e3af5e0ee26b1f5fc893d770a9298

Modified Files
--------------
src/bin/pg_basebackup/receivelog.c | 13 ++++++++++---
src/bin/pg_basebackup/walmethods.c |  9 ++++++---
2 files changed, 16 insertions(+), 6 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: pg_receivewal: Fix resource leaks and error reporting during cle
@ 2026-11-20 11:31  Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2026-11-20 11:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pg_receivewal: Fix resource leaks and error reporting during cleanup

Failures while finalizing LZ4 compression or writing the final compressed
data could leak a file descriptor and memory. Without --no-loop,
repeated failures across reconnects could accumulate these resources.

This happened because dir_close() returned immediately on these failures,
skipping the code that closes the file and releases its associated
resources. Fix this by closing the file and executing the common cleanup
code before returning.

Backpatch to all supported versions.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Xuneng Zhou <xunengzhou@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwHfCrEogr6=wr0nCkQevAJ9A3HBqQRjT9iJryO7EjF6Lw@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f22e8ad6748ac99f1438adc9fa9dfb6517e82623

Modified Files
--------------
src/bin/pg_basebackup/receivelog.c | 13 ++++++++++---
src/bin/pg_basebackup/walmethods.c |  9 ++++++---
2 files changed, 16 insertions(+), 6 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: pg_receivewal: Fix resource leaks and error reporting during cle
@ 2026-11-20 11:31  Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2026-11-20 11:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pg_receivewal: Fix resource leaks and error reporting during cleanup

Failures while finalizing LZ4 compression or writing the final compressed
data could leak a file descriptor and memory. Without --no-loop,
repeated failures across reconnects could accumulate these resources.

This happened because dir_close() returned immediately on these failures,
skipping the code that closes the file and releases its associated
resources. Fix this by closing the file and executing the common cleanup
code before returning.

Backpatch to all supported versions.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Xuneng Zhou <xunengzhou@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwHfCrEogr6=wr0nCkQevAJ9A3HBqQRjT9iJryO7EjF6Lw@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/bf700a0e9c8a48f1dd1e8e09c300c5e584c44a23

Modified Files
--------------
src/bin/pg_basebackup/receivelog.c | 13 ++++++++++---
src/bin/pg_basebackup/walmethods.c |  9 ++++++---
2 files changed, 16 insertions(+), 6 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: pg_receivewal: Fix resource leaks and error reporting during cle
@ 2026-11-20 11:31  Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2026-11-20 11:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pg_receivewal: Fix resource leaks and error reporting during cleanup

Failures while finalizing LZ4 compression or writing the final compressed
data could leak a file descriptor and memory. Without --no-loop,
repeated failures across reconnects could accumulate these resources.

This happened because dir_close() returned immediately on these failures,
skipping the code that closes the file and releases its associated
resources. Fix this by closing the file and executing the common cleanup
code before returning.

Backpatch to all supported versions.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Xuneng Zhou <xunengzhou@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwHfCrEogr6=wr0nCkQevAJ9A3HBqQRjT9iJryO7EjF6Lw@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f753bbf57809fc969efd17b3fd6f68e1da3ff979

Modified Files
--------------
src/bin/pg_basebackup/walmethods.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2026-11-20 11:31 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-11-20 11:31 pgsql: pg_receivewal: Fix resource leaks and error reporting during cle Fujii Masao <fujii@postgresql.org>
2026-11-20 11:31 pgsql: pg_receivewal: Fix resource leaks and error reporting during cle Fujii Masao <fujii@postgresql.org>
2026-11-20 11:31 pgsql: pg_receivewal: Fix resource leaks and error reporting during cle Fujii Masao <fujii@postgresql.org>
2026-11-20 11:31 pgsql: pg_receivewal: Fix resource leaks and error reporting during cle Fujii Masao <fujii@postgresql.org>
2026-11-20 11:31 pgsql: pg_receivewal: Fix resource leaks and error reporting during cle Fujii Masao <fujii@postgresql.org>
2026-11-20 11:31 pgsql: pg_receivewal: Fix resource leaks and error reporting during cle Fujii Masao <fujii@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox