From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 64A1546970F for ; Sat, 30 Nov 2019 13:54:57 +0300 (MSK) Received: by mail-lf1-f68.google.com with SMTP id d6so24391938lfc.0 for ; Sat, 30 Nov 2019 02:54:57 -0800 (PST) Date: Sat, 30 Nov 2019 13:54:54 +0300 From: Cyrill Gorcunov Message-ID: <20191130105454.GS19879@uranus> References: <20191129111903.GA7760@atlas> <20191129113659.GE19879@uranus> <20191129145028.GA18043@atlas> <20191129151410.GJ19879@uranus> <20191129183144.GB16921@atlas> <20191129191708.GN19879@uranus> <20191130041405.GB31199@atlas> <20191130073628.GP19879@uranus> <20191130100445.GA16163@atlas> <20191130104734.GR19879@uranus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191130104734.GR19879@uranus> Subject: Re: [Tarantool-patches] [PATCH 1/5] popen: Introduce a backend engine List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Konstantin Osipov Cc: tml On Sat, Nov 30, 2019 at 01:47:34PM +0300, Cyrill Gorcunov wrote: > On Sat, Nov 30, 2019 at 01:04:45PM +0300, Konstantin Osipov wrote: > > > > Could you provide a Lua example usage of popen() which would lead > > to the situation you describe here? > > > > Seems like in order for that to happen the Lua script has to > > provide both input and output streams to the called program, and > > in this case the script should not expect that there is any > > ordering in which the input is consumed and the output is > > produced. > > > > In any case discussing this problem would be easier if there is an > > example. > > An example is in one of my patch, here is it (result file) > --- ... > $ sh -c "prompt=''; read -n 5 prompt; echo -n $prompt" Forgot to mention that the example in previous message is for pipe opened in blocked mode. If o_nonblock used the script fails in "read" action. I think the main target now for me is to investigate which mode uses python in subprocess module and etc (simply because users are familiar with it and will expect us to behave the same I think).