Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Sfn3p-00071j-Kq for bitcoin-development@lists.sourceforge.net; Sat, 16 Jun 2012 07:04:41 +0000 Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of gmail.com designates 209.85.160.47 as permitted sender) client-ip=209.85.160.47; envelope-from=laanwj@gmail.com; helo=mail-pb0-f47.google.com; Received: from mail-pb0-f47.google.com ([209.85.160.47]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-MD5:128) (Exim 4.76) id 1Sfn3o-0004Bg-VY for bitcoin-development@lists.sourceforge.net; Sat, 16 Jun 2012 07:04:41 +0000 Received: by pbbrq2 with SMTP id rq2so5789857pbb.34 for ; Sat, 16 Jun 2012 00:04:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.240.99 with SMTP id vz3mr28394350pbc.60.1339830274908; Sat, 16 Jun 2012 00:04:34 -0700 (PDT) Received: by 10.143.44.2 with HTTP; Sat, 16 Jun 2012 00:04:34 -0700 (PDT) In-Reply-To: References: Date: Sat, 16 Jun 2012 09:04:34 +0200 Message-ID: From: Wladimir To: grarpamp Content-Type: multipart/alternative; boundary=047d7b3396ad9860e204c2918ba0 X-Spam-Score: -0.6 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (laanwj[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 1.0 HTML_MESSAGE BODY: HTML included in message -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1Sfn3o-0004Bg-VY Cc: bitcoin-development@lists.sourceforge.net Subject: Re: [Bitcoin-development] RPC and signals - processing priority X-BeenThere: bitcoin-development@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2012 07:04:41 -0000 --047d7b3396ad9860e204c2918ba0 Content-Type: text/plain; charset=UTF-8 On Fri, Jun 15, 2012 at 10:55 PM, grarpamp wrote: > While happily processing these: > received block ... > SetBestChain: new best=... height=... work=... > ProcessBlock: ACCEPTED > > bitcoind very often refuses to answer rpc queries such as getinfo/stop, > or signals such as kill/ctrl-c. It even registers: > ThreadRPCServer method=getinfo/stop > in the debug log. But the action doesn't happen as expected. > > Shouldn't it be checking and processing all user interrupts like > once per block and doing the chain in the background? > This has nothing to do with priority and "user interrupts", but with the locks on the wallet and client. Every RPC command takes both locks, and releases them only when finished. Shutting down also requires both locks, so the operations will be serialized. This protects the database and critical data structures. Sure, there might be some cases in which the locks are not necessary, or read/write locks could be used instead to improve concurrency, but this has to be approached really carefully. Wladimir --047d7b3396ad9860e204c2918ba0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Fri, Jun 15, 2012 at = 10:55 PM, grarpamp <grarpamp@gmail.com> wrote:
While happily processing these:
received block ...
SetBestChain: new best=3D... =C2=A0height=3D... =C2=A0work=3D...
ProcessBlock: ACCEPTED

bitcoind very often refuses to answer rpc queries such as getinfo/stop,
or signals such as kill/ctrl-c. It even registers:
=C2=A0ThreadRPCServer method=3Dgetinfo/stop
in the debug log. But the action doesn't happen as expected.

Shouldn't it be checking and processing all user interrupts like
once per block and doing the chain in the background?
=

This has nothing to do wi= th priority and "user interrupts", but with the locks on the wall= et and client. Every RPC command takes both locks, and releases them only w= hen finished.

Shutting down also requires both locks, so the operations wi= ll be serialized.

This protects the database and c= ritical data structures. Sure, there might be some cases in which the locks= are not necessary, or read/write locks could be used instead to improve co= ncurrency, but this has to be approached really carefully.

Wladimir

--047d7b3396ad9860e204c2918ba0--