Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fYoO6-0007le-Hc for pgsql-general@arkaria.postgresql.org; Fri, 29 Jun 2018 08:04:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fYoO4-0002V4-DA for pgsql-general@arkaria.postgresql.org; Fri, 29 Jun 2018 08:04:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fYoO4-0002Ux-5d for pgsql-general@lists.postgresql.org; Fri, 29 Jun 2018 08:04:12 +0000 Received: from sraihb2.sra.co.jp ([202.32.10.6]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fYoO0-0006uu-BT for pgsql-general@postgresql.org; Fri, 29 Jun 2018 08:04:11 +0000 Received: from srascf.sra.co.jp (srascf [133.137.8.80]) by sraihb2.sra.co.jp (Postfix) with ESMTP id 884D12A15D8 for ; Fri, 29 Jun 2018 17:04:05 +0900 (JST) Received: from srascb.sra.co.jp (unknown [133.137.8.65]) by srascf.sra.co.jp with smtp id 42a0_084e_74a6cd0e_9789_429e_a6fc_1991cb0c1b08; Fri, 29 Jun 2018 17:04:04 +0900 Received: from sranhm.sra.co.jp (osspc25 [133.137.174.97]) by srascb.sra.co.jp (Postfix) with ESMTP id 6D16A2D6942 for ; Fri, 29 Jun 2018 17:04:05 +0900 (JST) Received: from harukat-PC (sraihg-184.sra.co.jp [133.137.9.184]) by sranhm.sra.co.jp (Postfix) with SMTP id 09101A105E for ; Fri, 29 Jun 2018 17:04:04 +0900 (JST) Date: Fri, 29 Jun 2018 17:04:02 +0900 From: TAKATSUKA Haruka To: pgsql-general@postgresql.org Subject: Re: Windows 10 got stuck with PostgreSQL at starting up. Adding delay lets it avoid. Message-Id: <20180629170402.ce2b45b71b9b3da6472019b4@sraoss.co.jp> In-Reply-To: References: <20180629150310.b01664be02fde699ccc5f683@sraoss.co.jp> Organization: SRA OSS, Inc. X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.23; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, 29 Jun 2018 08:34:18 +0200 Thomas Kellerer wrote: > Did you try setting the service to "delayed start"? We didn't try it yet. Thanks to give an idea. I think that MS would advise us already if it were a just solution for this case. Anyway, we will try and confirm it. Thanks, Takatsuka Haruka > TAKATSUKA Haruka schrieb am 29.06.2018 um 08:03: > > I got a trouble in PostgreSQL 9.3.x on Windows 10. > > I would like to add new delay code as an official build option. > > > > Windows 10 sometime (approximately once in 300 tries) hung up > > at OS starting up. The logs say it happened while the PostgreSQL > > service was starting. When OS stopped, some postgres auxiliary > > process were started and some were not started yet. > > > > The Windows dump say some threads of the postgres auxiliary process > > are waiting OS level locks and the logon processes’thread are > > also waiting a lock. MS help desk said that PostgreSQL’s OS level > > deadlock caused OS freeze. I think it is strange story. But, > > in fact, it not happened in repeated tests when I got rid of > > PostgreSQL from the initial auto-starting services. > > > > I tweaked PostgreSQL 9.3.x (the newest from the repository) to add > > 0.5 or 3.0 seconds delay after each sub process starts. > > And then the hung up was gone. This test patch is attached. > > It is only implemented for Windows. Also, I did not use existing > > pg_usleep because it contains locking codes (e.g. WaitForSingleObject > > and Enter/LeaveCriticalSection). > > > > Although Windows OS may have some problems, I think we should have > > a means to avoid it. Can PostgreSQL be accepted such delay codes > > as build-time options by preprocessor variables?