forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitdf27d76
committed
Disconnect if socket cannot be put into non-blocking mode
Commit387da18 moved the code to put socket into non-blocking modefrom socket_set_nonblocking() into the one-time initializationfunction, pq_init(). In socket_set_nonblocking(), there indeed was arisk of recursion on failure like the comment said, but in pq_init(),ERROR or FATAL is fine. There's even another elog(FATAL) just afterthis, if setting FD_CLOEXEC fails.Note that COMMERROR merely logged the error, it did not close theconnection, so if putting the socket to non-blocking mode failed wewould use the connection anyway. You might not immediately notice,because most socket operations in a regular backend wait for thesocket to become readable/writable anyway. But e.g. replication willbe quite broken.Backpatch to all supported versions.Discussion:https://www.postgresql.org/message-id/d40a5cd0-2722-40c5-8755-12e9e811fa3c@iki.fi1 parent80db5a3 commitdf27d76
1 file changed
+1
-5
lines changedLines changed: 1 addition & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
209 | 209 |
| |
210 | 210 |
| |
211 | 211 |
| |
212 |
| - | |
213 |
| - | |
214 |
| - | |
215 |
| - | |
216 | 212 |
| |
217 | 213 |
| |
218 | 214 |
| |
219 |
| - | |
| 215 | + | |
220 | 216 |
| |
221 | 217 |
| |
222 | 218 |
| |
|
0 commit comments
Comments
(0)