DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 45IEjYUF2786404 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=kqgC4Gib X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CEEFA3882AEE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1718721931; bh=BJLGgPNokOZfgdAzJ6QX2ZW3L+6BR42vSTOANZU/nC4=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=kqgC4Gib0dmiOhLahJbR8+LqE0Ob97bgY+slxMSdYeqkrj7rthFEQszpXauwD1K5Z LjhR/UJnbCS6vXL4Lk5XwsGIJyCRU1d9OGJPRH02NLxz17qPoZB0EL6Z0B7eDg2F+o XaowoFephbgY0bl33cWhAyN68WWVusKVBHrBxzy0= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EFA9D3882ACB ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EFA9D3882ACB ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718721912; cv=none; b=fzXjze2XqqsMijBRniX7TL5dpuD5MsqhhSfp5VaLmgIh93uF7Y9ximXt/coQGjKHwkqjIoAdFjkuHLFATx76Yu1lnts4W0/cBMTwLUsYoo2W3i4zhL9iTl3M2VBjksAWtCRBJ2OcrCvyDLtRSH2QF9a6BYOeHM/gnEWkI7GDJuE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718721912; c=relaxed/simple; bh=VHtDSzXtn5jrkoBMtCleLWCoaSGcTsJUV/Xt5vrZ57w=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=Zt9hEnpDsXu3aeJhreDXVfkgMQT16c/qscrlYUiDTCaGa6d/fr0XZwu9hg7LW9BOBSe7ZSVrcRC1uK8Kmp9znmPBWYbA5UJrzutJ90mPXQMT5BTUPx0hSFc1cHI8ydxvEY7soZS4sWHOwelbg9X6z2z+v+aw62gvicdp72Hm7aM= ARC-Authentication-Results: i=1; server2.sourceware.org X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718721908; x=1719326708; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Gb+kJcFgGAg760GqnYIsnk2k16YUg/IsRRPFwHSMFLU=; b=aKq03qQnLQqLwkCHsAu/ETQEU/TCFLvN1U4GDPapRPjELp49qWv/QN73mlQlDfq+LJ VtxJo4wq+EzIAGC99yrwZptLtp1K9g3i4y3zmuiCNYpXszfn9DjW0aPjGR0odO1lKK+t qJhKdU3X0yxS+1pmYy5pekw30TkDc2W+ke4Eis1FWSIE8XgKQfS5iomXLnH2Eq1Awa/0 c6zFtQr+7Ybkx6VBulzQQXxVLIc5Xc86JLl+ktSM3GNklrj5sMQXcMdSXMeZZ3b2KPsV NIPUJLB50f7vT7L8LygwYUcunm1SAnlcp92g7yfzOQQiqT7xzJSRSsop4aPY9PB9ZMjn CtBw== X-Gm-Message-State: AOJu0Yz4orEu1ueXcTum6gpmkqpnBY/uAkBvRSDnuB2Xr1kOJHFVFKNK 3ZN6CzzsHaKfL5LJWOmzDTxUvgPz2A8eXAWEbH7NvHjCvk+VNlaIaqvk4r8zeOsW6r8u39Nnp8h ICMpd2Bzf5q+f6yYI8e6gDGJahuc02Q== X-Google-Smtp-Source: AGHT+IF4Ik6dQAvg2NNkKFGKTCG5mD14X+YEW6g3bH/qTxhwkRtrJ0AilIbgAqFfDIFDEyxAHwFqQOo8yeZj6EWPmjc= X-Received: by 2002:a19:4319:0:b0:52c:8591:1f7b with SMTP id 2adb3069b0e04-52ca6e659a9mr7595023e87.24.1718721907855; Tue, 18 Jun 2024 07:45:07 -0700 (PDT) MIME-Version: 1.0 References: <1399464798 DOT 20240617105808 AT yandex DOT ru> In-Reply-To: Date: Tue, 18 Jun 2024 16:44:00 +0200 Message-ID: Subject: Re: Cygwin outputting message to stderr on dofork EAGAIN failure even when Python exception is caught and handled To: "cygwin AT cygwin DOT com" X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 List-Id: General Cygwin discussions and problem reports List-Archive: List-Post: List-Help: List-Subscribe: , From: Dan Shelton via Cygwin Reply-To: Dan Shelton Content-Type: text/plain; charset="utf-8" Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 45IEjYUF2786404 On Mon, 17 Jun 2024 at 18:03, Dale Lobb (Sys Admin) via Cygwin wrote: > > Greetings, Nicholas; > > > From: Cygwin On Behalf Of Andrey Repin via Cygwin > > Sent: Monday, June 17, 2024 2:58 AM > > To: Nicholas Williams ; cygwin AT cygwin DOT com > > Cc: Andrey Repin > > Subject: EXTERNAL SENDER: Re: Cygwin outputting message to stderr on dofork EAGAIN failure even when Python exception is caught and handled > > > > Greetings, Nicholas Williams! > We have a Python (installed and run through Cygwin) process running on > Windows Server 2022 that was very, very occasionally failing when subprocess. check_output was called: > 0 [main] python3 28481 > > > > Greetings, Nicholas Williams! > > > > > We have a Python (installed and run through Cygwin) process running on > > > Windows Server 2022 that was very, very occasionally failing when subprocess.check_output was called: > > > > > 0 [main] python3 28481 dofork: child -1 - forked process 16856 died > > > unexpectedly, retry 0, exit code 0xC0000142, errno 11 > > > … > > > subprocess.check_output(["cygpath", "-w", directory.name], encoding="utf-8").strip() > > > File "/usr/lib/python3.9/subprocess.py", line 424, in check_output <> > > > <>return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, <> > > > File "/usr/lib/python3.9/subprocess.py", line 505, in run <> > > > <>with Popen(*popenargs, **kwargs) as process: <> > > > File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ <> > > > <>self._execute_child(args, executable, preexec_fn, close_fds, <> > > > File "/usr/lib/python3.9/subprocess.py", line 1754, in _execute_child > > > self.pid = _posixsubprocess.fork_exec( > > > BlockingIOError: [Errno 11] Resource temporarily unavailable > > > > > Setting aside for a minute the various reasons this might be happening > > > occasionally, which we cannot solve for at this moment, the error number > > > (EAGAIN) indicates that you should “try again.” So that’s exactly what we > > > did. We added a try/catch to the Python code to catch the BlockingIOError > > > and, if and only if the error number is EAGAIN, we try up to two more times. > > > This fixed the problem and caused the application to stop quitting. We > > > output a warning to our log so that we don’t forget about the problem, but > > > the warning only ever appears once, so retrying a single time seems to help. > > > > > However … even though Python handles the dofork error, turns it into a > > > Python exception, and our code catches the Python exception and handles it > > > properly, Cygwin (not Python … Cygwin) still outputs a message to stderr > > > right before our warning message. This Cygwin error message shows up as an error in our log tracking: > > > > > 0 [main] python3 15042 dofork: child -1 - forked process 6780 died > > > unexpectedly, retry 0, exit code 0xC0000142, errno 11 > > > 06/16 13:57:53. 87520: WARNING: Retrying command in 2 seconds due to EAGAIN: [the command we’re running] Does python require fork(), or can it use posix_spawn() in this case? Dan -- Dan Shelton - Cluster Specialist Win/Lin/Bsd -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple