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 1faI8H-0001ge-2A for pgsql-general@arkaria.postgresql.org; Tue, 03 Jul 2018 10:02:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1faI8E-0005xy-GS for pgsql-general@arkaria.postgresql.org; Tue, 03 Jul 2018 10:01:58 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1faI8E-0005xr-0J for pgsql-general@lists.postgresql.org; Tue, 03 Jul 2018 10:01:58 +0000 Received: from sraihb2.sra.co.jp ([202.32.10.6]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1faI86-0004lG-GA for pgsql-general@postgresql.org; Tue, 03 Jul 2018 10:01:56 +0000 Received: from srascf.sra.co.jp (srascf [133.137.8.80]) by sraihb2.sra.co.jp (Postfix) with ESMTP id 11EFC2A15F2 for ; Tue, 3 Jul 2018 19:01:48 +0900 (JST) Received: from srascb.sra.co.jp (unknown [133.137.8.65]) by srascf.sra.co.jp with smtp id 480c_0e98_bc488ca7_9f86_4314_b813_7e6907045297; Tue, 03 Jul 2018 19:01:47 +0900 Received: from sranhm.sra.co.jp (osspc25 [133.137.174.97]) by srascb.sra.co.jp (Postfix) with ESMTP id EA54E2D6942 for ; Tue, 3 Jul 2018 19:01:47 +0900 (JST) Received: from harukat-PC (dhcp-175-95.sra.co.jp [133.137.175.95]) by sranhm.sra.co.jp (Postfix) with SMTP id CE41AA0DBD for ; Tue, 3 Jul 2018 19:01:47 +0900 (JST) Date: Tue, 3 Jul 2018 19:01:47 +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: <20180703190147.062405755bcd436e6403b692@sraoss.co.jp> In-Reply-To: <20180629170402.ce2b45b71b9b3da6472019b4@sraoss.co.jp> References: <20180629150310.b01664be02fde699ccc5f683@sraoss.co.jp> <20180629170402.ce2b45b71b9b3da6472019b4@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. We tried it. "Delayed start" was ineffective. Also setting a script that start the PostgreSQL service on the "startup" folder was ineffective. It has not been solved except by PostgreSQL code modification (inserting delay). Thanks, Haruka Takatsuka > > 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?