Bug #75680 [Com]: On Windows, While script(PDO) executing... by SIGINT(ctrl+c).

From: Date: Tue, 23 Jan 2018 03:04:43 +0000
Subject: Bug #75680 [Com]: On Windows, While script(PDO) executing... by SIGINT(ctrl+c).
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213671@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75680&edit=1 ID: 75680 Comment by: mattficken@php.net Reported by: spongi1019 at naver dot com Summary: On Windows, While script(PDO) executing... by SIGINT(ctrl+c). Status: Open Type: Bug Package: PDO PgSQL Operating System: Windows7 PHP Version: 7.1.12 Block user comment: N Private report: N New Comment: Windows doesn't reallocate the port# for 240 seconds(by default) after the connection is closed -- to ensure that, the connection is left in that table. This is in case additional packets are sent by the other side after the connection is closed on this side. This time is controlled by the registry key: HKEY_LOCAL_MACHINE \System \CurrentControlSet \services \Tcpip \Parameters For higher web server performance, you can decrease this time. Otherwise, its fine. Its just a behavior difference (though behavior specified in IETF RFC 793). Without more info, I assume this is what the issue here is... in which case, this can be closed as not a bug. Maybe this should be in the PHP manual for socket() (since its is a generic TCP behavior not just PgSQL). Previous Comments: ------------------------------------------------------------------------ [2018-01-16 03:20:07] mattficken@php.net Please try again and wait 50 seconds and run netstat again and then again at 60 seconds (so 2 netstats, one 60 seconds after socket created and one 60 seconds after database connection closed). Just checking, is the database server localhost (127.0.0.1) ?? ------------------------------------------------------------------------ [2017-12-14 02:50:32] spongi1019 at naver dot com Description: ------------ I have a weird happening. On Windows, I executed below the script. {code} <?php $pdo = new PDO('pgsql:host=xxxxxxxx;dbname=postgres;port=5432', 'postgres', 'mypassword'); sleep(600); {code} After 10 seconds, I stopped the script by SIGINT(CTRL+C). And then I saw the 'netstat' in Postgresql server. I expected not to see the 'established connection'. However, I saw the 'established connection'. {code} tcp 0 0 xxx.xxx.xxx.xxx:5432 xxx.xxx.xxx.xxx:64682 ESTABLISHED 26620/postgres: pos {code} Why it happened? P.S On Linux(centos7), it was the same that I expected. (could not see 'established connection') Test script: --------------- <?php $pdo = new PDO('pgsql:host=xxxxxxxx;dbname=postgres;port=5432', 'postgres', 'mypassword'); sleep(600); Expected result: ---------------- close connection(not established) Actual result: -------------- tcp 0 0 xxx.xxx.xxx.xxx:5432 xxx.xxx.xxx.xxx:64682 ESTABLISHED 26620/postgres: pos ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75680&edit=1

« previous php.bugs (#213671) next »