Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XzXH9-0006eZ-AN for pgsql-odbc@arkaria.postgresql.org; Fri, 12 Dec 2014 20:57:23 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XzXH8-0007Cc-Lg for pgsql-odbc@arkaria.postgresql.org; Fri, 12 Dec 2014 20:57:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XzXH7-0007CV-N7 for pgsql-odbc@postgresql.org; Fri, 12 Dec 2014 20:57:21 +0000 Received: from smtp-outbound-2.vmware.com ([208.91.2.13]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XzXH2-0003Xj-20 for pgsql-odbc@postgresql.org; Fri, 12 Dec 2014 20:57:20 +0000 Received: from sc9-mailhost1.vmware.com (sc9-mailhost1.vmware.com [10.113.161.71]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 7289929253; Fri, 12 Dec 2014 12:57:10 -0800 (PST) Received: from EX13-CAS-006.vmware.com (EX13-CAS-006.vmware.com [10.113.191.56]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id 6CF931912F; Fri, 12 Dec 2014 12:57:10 -0800 (PST) Received: from EX13-MBX-024.vmware.com (10.113.191.44) by EX13-MBX-006.vmware.com (10.113.191.26) with Microsoft SMTP Server (TLS) id 15.0.913.22; Fri, 12 Dec 2014 12:57:10 -0800 Received: from [192.168.1.90] (10.113.160.246) by EX13-MBX-024.vmware.com (10.113.191.44) with Microsoft SMTP Server (TLS) id 15.0.913.22; Fri, 12 Dec 2014 12:57:09 -0800 Message-ID: <548B569D.4040008@vmware.com> Date: Fri, 12 Dec 2014 22:57:01 +0200 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0 MIME-Version: 1.0 To: Gaurav Srivastava , Subject: Re: High CPU shoot during poll retry References: In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.113.160.246] X-ClientProxiedBy: EX13-CAS-013.vmware.com (10.113.191.65) To EX13-MBX-024.vmware.com (10.113.191.44) X-Pg-Spam-Score: -6.9 (------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org On 12/12/2014 12:31 PM, Gaurav Srivastava wrote: > Hi All, > > In ODBC library later to change done as part of commit Title "Rip out > broken retry/timeout logic in SOCK_wait_for_ready." in file socket.c > > Now the cpde snippet for SOCK_wait_for_ready() is like: > > do { > #ifdef HAVE_POLL > fds.fd = sock->socket; > fds.events = output ? POLLOUT : POLLIN; > fds.revents = 0; > * ret = poll(&fds, 1, nowait ? 0 : -1); * > mylog("!!! poll ret=%d revents=%x\n", ret, fds.revents); > #else > FD_ZERO(&fds); > FD_ZERO(&except_fds); > FD_SET(sock->socket, &fds); > FD_SET(sock->socket, &except_fds); > if (nowait) > { > tm.tv_sec = 0; > tm.tv_usec = 0; > } > ret = select((int) sock->socket + 1, output ? NULL : &fds, > output ? &fds : NULL, &except_fds, nowait ? &tm : NULL); > #endif /* HAVE_POLL */ > gerrno = SOCK_ERRNO; > } *while (ret < 0 && EINTR == gerrno);* > > > > So whenever there is no fd is ready to be read it will immediately return > and solve the issue of infinite query hung but due to immediate return it > will go for continuous retries and causing CPU to shoot very high.This is > one of the case we are suffering in our scenario after upgrading ODBC. Why do you think it will go into continuous retries? - Heikki -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc