pg18: leaks io-uring FDs during restart_after_crash

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: pg18: leaks io-uring FDs during restart_after_crash
Date: 2025-10-17 20:29:53
Message-ID: aPKnQQggfNPsInWA@pryzbyj2023
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

If a backend crashes/killed due to OOM, then the FDs opened in the
postmaster aren't closed, so after a few crashes you can end up with a
multiple as many FDs opened. Which can then lead to queries failing
with "too many opened files".

$ postgres -c io_method=io_uring &
$ lsof -p 3732231 2>/dev/null |grep -c io_uring
284
$ kill -9 3732232
$ lsof -p 3732231 2>/dev/null |grep -c io_uring
568

I'm not sure, but that might be related to these other errors.

error_severity | ERROR
sql_state_code | XX000
message | could not read blocks 122..126 in file "base/246942/132857974": Operation canceled
query | SELECT DISTINCT attrelid FROM pg_attribute WHERE attacl IS NOT NULL
application_name | pg_dump

--
Justin

Browse pgsql-hackers by date

  From Date Subject
Next Message Arseniy Mukhin 2025-10-17 20:50:53 Re: LISTEN/NOTIFY bug: VACUUM sets frozenxid past a xid in async queue
Previous Message Tom Lane 2025-10-17 20:19:42 Re: abi-compliance-check failure due to recent changes to pg_{clear,restore}_{attribute,relation}_stats()