From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id WH7qNDAsNGeJCgAAe85BDQ:P1 (envelope-from ) for ; Wed, 13 Nov 2024 04:33:53 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id WH7qNDAsNGeJCgAAe85BDQ (envelope-from ) for ; Wed, 13 Nov 2024 05:33:53 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=mailfence.com header.s=20240605-akrp header.b=OBjfdE6u; dmarc=pass (policy=reject) header.from=mailfence.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1731472432; a=rsa-sha256; cv=none; b=Gjdg/s2jI3igej0BZG5rl7RmAZDZi0oD8vD9b55khz6C1BKYz4OoZgE6dzC4SpacfLWmCa 9LypY+Ta7z5QcrOtHsPVkv/uYYTdwmuN+vCcwgtUnkyMjlkiU5FFwa+jd/tiokKLKgDZtf FLgTAIFIKR1i2mwsimiAZbDIOYWoXkc4JCStnbqgw/MSEd5TrZlzc2VdqFuGgCpsVIGO0t 3UpsD0l+WpRBpCR8Jf/MMROcOdtbIFb+8ZB0FrdQu+WEIVNs+QOYsQpI+LkCZckCow1NPn ptyyVMtjCN57TyzqOOZXJ6aJIM3i0wsfNupmzvGANcG2RaMEfubsNNeqhb6mOQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=mailfence.com header.s=20240605-akrp header.b=OBjfdE6u; dmarc=pass (policy=reject) header.from=mailfence.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1731472432; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Uggzyrcb2e4QVaU6ZirLlgafXSyWPRQGzQdc0fAM6z8=; b=aJotZfZRzfDLh7aoLAzoErHZIUe8A0fJ2kLxbnvwmaMhI0E6iTaXKs3Zuj/BHnc0xRgrsP IVIWTNsoK18m5FssD8PgXrcLgvM2kpGn6ZmHkH2bt9qzdcfpHRQiRvZ5FzMAvkvl1wq84x wAaxEOLJyLFJZ0u21xYHms2dFPNiabwGfeEX/DaqvntyeuC6pSttdqv6IcS3ZXXOni9QCg TznV+GISbwVYq5G3H4IJTnm5qgGNxVxg7c1qAajdfAAlGiyp5hRTmXP8Jc94YEYgYr6A35 QjeJ7H8xajlvs5whtp8zdQk/IK0Lx+vvvwBIqn9TVLpU/g3DE/oZiJhOH1tPYA== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6D2EB7C741 for ; Wed, 13 Nov 2024 05:33:52 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tB4z1-0002rF-Iy; Tue, 12 Nov 2024 23:27:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tB4yu-0002qo-1j for emacs-orgmode@gnu.org; Tue, 12 Nov 2024 23:27:53 -0500 Received: from wilbur.contactoffice.com ([212.3.242.68]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tB4yr-0002xN-W2 for emacs-orgmode@gnu.org; Tue, 12 Nov 2024 23:27:51 -0500 Received: from smtpauth2.co-bxl (smtpauth2.co-bxl [10.2.0.24]) by wilbur.contactoffice.com (Postfix) with ESMTP id 828E846E5 for ; Wed, 13 Nov 2024 05:27:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1731472063; s=20240605-akrp; d=mailfence.com; i=pareto.optimal@mailfence.com; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; bh=Uggzyrcb2e4QVaU6ZirLlgafXSyWPRQGzQdc0fAM6z8=; b=OBjfdE6uXzjYCk6RmG8e3DBlppCEkKlfy4aRuapwTacVhzcamUfGOQ4FLte0ijLV 2JQhcCPWf2yEp1Lj+qt+TbLOoFYf+jbVbNa2qqBzlRF4XfVWYsnHHXg0RtbnCls2UiT /ddsQsTx3BFeeZTxOKmnfeF8XDhCPrt570eVffbPAYMJJjMpG5HthPWnk452JxmttrT FupFfSIXEc3T6TPiAI+175Y7Jldm0GNcpS3l24Vr4fpLK+UHMovEQEZ0ANpJcsqjD1Q FKwnAkd5a2lL4knrpuagzgpUFD/G3qS3a3sNjyu40754NXF21VbyFb25SDMFIrtPCzY yZT3/QL/MQ== Received: by smtp.mailfence.com with ESMTPSA for ; Wed, 13 Nov 2024 05:27:41 +0100 (CET) From: ParetoOptimal To: emacs-orgmode@gnu.org Subject: [BUG] ob-shell async session does not work with multiple blocks running [9.7.16 (9.7.16-ba9734 @ /nix/store/6la93ywyb1h055phgyqba7h7qay60p0m-emacs-packages-deps/share/emacs/site-lisp/elpa/org-9.7.16/)] Date: Tue, 12 Nov 2024 22:27:38 -0600 Message-ID: <87zfm369mt.fsf@mailfence.com> MIME-Version: 1.0 Content-Type: text/plain X-ContactOffice-Account: com:311504211 Received-SPF: pass client-ip=212.3.242.68; envelope-from=pareto.optimal@mailfence.com; helo=wilbur.contactoffice.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.32 X-Spam-Score: -3.32 X-Migadu-Queue-Id: 6D2EB7C741 X-Migadu-Scanner: mx10.migadu.com X-TUID: fp8rhXCbFhOC Problem: Running two shell source blocks with the same session doesn't properly extract out results from the sentinel value relating to each respective source block. This could be a known issue which might make this an enhancement request rather than a bug report. Expected: Running two source blocks at once to properly deal with only their values from the "foo-comint-indirect" buffer. Given: #+begin_src sh :session foo :async sleep 5 echo "almost done" sleep 3 echo "done" #+end_src #+begin_src sh :session foo :async sleep 1 echo "almost done" sleep 6 echo "done" #+end_src Then running these right after another using: M-< ;; beginning-of-buffer C-c C-v C-n ;; org-babel-next-src-block C-c C-c ;; org-ctrl-c-ctrl-c C-c C-v C-n ;; org-babel-next-src-block C-c C-c ;; org-ctrl-c-ctrl-c You never get the results for the last source block, but there are 3 stages: 1. After evaluating each block, but before either is done: #+begin_src sh :session foo :async sleep 5 echo "almost done" sleep 3 echo "done" #+end_src #+RESULTS: : 4466c6fe-e7b5-4c14-9cae-d8f066ec6ebf #+begin_src sh :session foo :async sleep 1 echo "almost done" sleep 6 echo "done" #+end_src #+RESULTS: : 17c8a088-82c4-4695-90f6-fe3cba9fcfd7 2. After the first is finished running (notice the clobbered results pulled in from the other block, this is the bug) #+begin_src sh :session foo :async sleep 5 echo "almost done" sleep 3 echo "done" #+end_src #+RESULTS: : echo 'ob_comint_async_shell_start_17c8a088-82c4-4695-90f6-fe3cba9fcfd7' : sleep 1 : echo "almost done" : sleep 6 : echo "done" : echo 'ob_comint_async_shell_end_17c8a088-82c4-4695-90f6-fe3cba9fcfd7' : almost done : done #+begin_src sh :session foo :async sleep 1 echo "almost done" sleep 6 echo "done" #+end_src #+RESULTS: : 17c8a088-82c4-4695-90f6-fe3cba9fcfd7 3. Something is done to fixup the results from the first source block, but the second source block never gets updated with it's results #+begin_src sh :session foo :async sleep 5 echo "almost done" sleep 3 echo "done" #+end_src #+RESULTS: : almost done : done #+begin_src sh :session foo :async sleep 1 echo "almost done" sleep 6 echo "done" #+end_src #+RESULTS: : 17c8a088-82c4-4695-90f6-fe3cba9fcfd7 Here is what the foo-comint-indirect buffer looks like: org_babel_sh_prompt> echo 'ob_comint_async_shell_start_4466c6fe-e7b5-4c14-9cae-d8f066ec6ebf' sleep 5 echo "almost done" sleep 3 echo "done" echo 'ob_comint_async_shell_end_4466c6fe-e7b5-4c14-9cae-d8f066ec6ebf' ob_comint_async_shell_start_4466c6fe-e7b5-4c14-9cae-d8f066ec6ebf org_babel_sh_prompt> echo 'ob_comint_async_shell_start_17c8a088-82c4-4695-90f6-fe3cba9fcfd7' sleep 1 echo "almost done" sleep 6 echo "done" echo 'ob_comint_async_shell_end_17c8a088-82c4-4695-90f6-fe3cba9fcfd7' org_babel_sh_prompt> almost done org_babel_sh_prompt> org_babel_sh_prompt> done org_babel_sh_prompt> ob_comint_async_shell_end_4466c6fe-e7b5-4c14-9cae-d8f066ec6ebf org_babel_sh_prompt> ob_comint_async_shell_start_17c8a088-82c4-4695-90f6-fe3cba9fcfd7 org_babel_sh_prompt> org_babel_sh_prompt> almost done org_babel_sh_prompt> org_babel_sh_prompt> done org_babel_sh_prompt> ob_comint_async_shell_end_17c8a088-82c4-4695-90f6-fe3cba9fcfd7 org_babel_sh_prompt> Thanks for the great feature. Just allowing for long running shell blocks to not block doing things in emacs was a great addition. Emacs : GNU Emacs 29.4 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.18.2, Xaw3d scroll bars) Package: Org mode version 9.7.16 (9.7.16-ba9734 @ /nix/store/6la93ywyb1h055phgyqba7h7qay60p0m-emacs-packages-deps/share/emacs/site-lisp/elpa/org-9.7.16/)