postgresql/src/backend
Heikki Linnakangas 4fce5f970d Disconnect if socket cannot be put into non-blocking mode
Commit 387da18874 moved the code to put socket into non-blocking mode
from socket_set_nonblocking() into the one-time initialization
function, pq_init(). In socket_set_nonblocking(), there indeed was a
risk of recursion on failure like the comment said, but in pq_init(),
ERROR or FATAL is fine. There's even another elog(FATAL) just after
this, if setting FD_CLOEXEC fails.

Note that COMMERROR merely logged the error, it did not close the
connection, so if putting the socket to non-blocking mode failed we
would use the connection anyway. You might not immediately notice,
because most socket operations in a regular backend wait for the
socket to become readable/writable anyway. But e.g. replication will
be quite broken.

Backpatch to all supported versions.

Discussion: https://www.postgresql.org/message-id/d40a5cd0-2722-40c5-8755-12e9e811fa3c@iki.fi
2024-03-12 10:18:50 +02:00
..
access Promote assertion about !ReindexIsProcessingIndex to runtime error. 2024-02-25 16:15:07 -05:00
backup Skip .DS_Store files in server side utils 2024-02-13 13:47:12 +01:00
bootstrap Process session_preload_libraries within InitPostgres's transaction. 2022-07-25 10:27:43 -04:00
catalog Backpatch missing check_stack_depth() to some recursive functions 2024-03-11 03:06:45 +02:00
commands Backpatch missing check_stack_depth() to some recursive functions 2024-03-11 03:06:45 +02:00
executor Fix incorrect accessing of pfree'd memory in Memoize 2024-03-11 18:21:23 +13:00
foreign Rename SetSingleFuncCall() to InitMaterializedSRF() 2022-10-18 10:22:40 +09:00
jit Track LLVM 18 changes. 2024-01-25 13:46:07 +13:00
lib Fix lock assertions in dshash.c. 2022-07-11 16:01:22 +12:00
libpq Disconnect if socket cannot be put into non-blocking mode 2024-03-12 10:18:50 +02:00
main Fix outdated --help message for postgres -f 2022-08-15 13:37:32 +09:00
nodes Handle WindowClause.runCondition in tree walker/mutator functions. 2024-01-10 13:36:34 -05:00
optimizer Backpatch missing check_stack_depth() to some recursive functions 2024-03-11 03:06:45 +02:00
parser MERGE ... DO NOTHING: require SELECT privileges 2024-02-21 17:18:52 +01:00
partitioning Fix incorrect pruning of NULL partition for boolean IS NOT clauses 2024-02-20 12:50:34 +13:00
po Translation updates 2024-02-05 14:47:58 +01:00
port Close socket in case of errors in setting non-blocking 2024-01-17 11:24:11 +01:00
postmaster Avoid calling proc_exit() in processes forked by system(). 2023-10-17 10:42:06 -05:00
regex Avoid character classification in regex escape parsing. 2023-04-21 08:20:17 -07:00
replication Fix catalog lookup due to wrong snapshot for subtransactions during decoding. 2024-01-29 10:42:41 +05:30
rewrite Fix RLS policy usage in MERGE. 2023-08-07 09:24:27 +01:00
snowball In the Snowball dictionary, don't try to stem excessively-long words. 2022-08-31 10:42:05 -04:00
statistics Fix incorrectly reported stats kind in "can't happen" ERROR 2024-03-05 16:18:19 +13:00
storage Fix 'mmap' DSM implementation with allocations larger than 4 GB 2024-02-13 21:25:27 +02:00
tcop Be more rigorous about local variables in PostgresMain(). 2023-07-10 12:14:34 -04:00
tsearch Limit to_tsvector_byid's initial array allocation to something sane. 2023-09-25 11:50:28 -04:00
utils Backpatch missing check_stack_depth() to some recursive functions 2024-03-11 03:06:45 +02:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Move basebackup code to new directory src/backend/backup 2022-08-10 14:03:09 -04:00
nls.mk Translation updates 2023-11-06 13:16:22 +01:00