Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf1cb756

Browse files
committed
Add KEEPALIVE option to the socket of backend. This will automatically
terminate the backend that has no frontend anymore.
1 parent0d62ecd commitf1cb756

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

‎src/backend/libpq/pqcomm.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
3030
* Portions Copyright (c) 1994, Regents of the University of California
3131
*
32-
*$Id: pqcomm.c,v 1.89 2000/04/14 00:51:58 tgl Exp $
32+
*$Id: pqcomm.c,v 1.90 2000/05/20 13:10:54 ishii Exp $
3333
*
3434
*-------------------------------------------------------------------------
3535
*/
@@ -375,7 +375,13 @@ StreamConnection(int server_fd, Port *port)
375375
if (setsockopt(port->sock,pe->p_proto,TCP_NODELAY,
376376
&on,sizeof(on))<0)
377377
{
378-
perror("postmaster: StreamConnection: setsockopt");
378+
perror("postmaster: StreamConnection: setsockopt(TCP_NODELAY)");
379+
returnSTATUS_ERROR;
380+
}
381+
if (setsockopt(port->sock,SOL_SOCKET,SO_KEEPALIVE,
382+
&on,sizeof(on))<0)
383+
{
384+
perror("postmaster: StreamConnection: setsockopt(SO_KEEPALIVE)");
379385
returnSTATUS_ERROR;
380386
}
381387
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp