From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (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 B885D46970F for ; Sat, 30 Nov 2019 07:14:08 +0300 (MSK) Received: by mail-lj1-f194.google.com with SMTP id m4so33898758ljj.8 for ; Fri, 29 Nov 2019 20:14:08 -0800 (PST) Date: Sat, 30 Nov 2019 07:14:05 +0300 From: Konstantin Osipov Message-ID: <20191130041405.GB31199@atlas> References: <20191128204512.19732-1-gorcunov@gmail.com> <20191128204512.19732-2-gorcunov@gmail.com> <20191129055939.GH15149@atlas> <20191129094059.GA19879@uranus> <20191129111903.GA7760@atlas> <20191129113659.GE19879@uranus> <20191129145028.GA18043@atlas> <20191129151410.GJ19879@uranus> <20191129183144.GB16921@atlas> <20191129191708.GN19879@uranus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191129191708.GN19879@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: Cyrill Gorcunov Cc: tml * Cyrill Gorcunov [19/11/30 07:03]: > Once we sart using non-blocking IO the read() could return -EAGAIN. > I think I need to find out how python is handling this situation, > is their read is blocking or not. Take a look at how coio works. It adds the descriptor to the event loop and yields the current fiber. > > The eio reaps children itself, ie calls for wait. Thus imagine a situation, > we start killing the process like > > popen_kill(handle) > ... > kill(handle->pid) > ... > > but before we reach kill() this process exited by self or killed > by a user on the node. The signal handler sets pid = -1 and we > call kill(-1). Which is wrong of course. Can't you check the pid > 0 before you send the signal? -- Konstantin Osipov, Moscow, Russia