~rjarry/aerc-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 3

[PATCH aerc] ipc: fix deadlock when aerc is not running

Details
Message ID
<20240219203404.334215-3-robin@jarry.cc>
DKIM signature
pass
Download raw message
Patch: +7 -4
Defer the execution of failed IPC commands *after* the IPC socket has
been unblocked.

Fixes: fd4dd4240885 ("ipc: wait for app to be ready before accepting commands")
Fixes: https://todo.sr.ht/~rjarry/aerc/229
Reported-by: Skejg <grolleman@zoho.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
---
 main.go | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/main.go b/main.go
index 4cc8d2034e9b..85538311011e 100644
--- a/main.go
+++ b/main.go
@@ -164,7 +164,6 @@ func main() {
		if err == nil {
			return // other aerc instance takes over
		}
		fmt.Fprintf(os.Stderr, "Failed to communicate to aerc: %v\n", err)
		// continue with setting up a new aerc instance and retry after init
		retryExec = true
	}
@@ -211,7 +210,11 @@ func main() {
	// set the aerc version so that we can use it in the template funcs
	templates.SetVersion(Version)

	if retryExec {
	enableIpc := func() {
		startupDone()
		if !retryExec {
			return
		}
		// retry execution
		err := ipc.ConnectAndExec(opts.Command)
		if err != nil {
@@ -220,7 +223,7 @@ func main() {
			if err != nil {
				log.Warnf("failed to close backends: %v", err)
			}
			return
			os.Exit(1)
		}
	}

@@ -253,7 +256,7 @@ loop:
			// it will be ready. And in some cases, it may never be.
			// At least, we can be confident that accepting IPC
			// commands will not crash the whole process.
			once.Do(startupDone)
			once.Do(enableIpc)
		case callback := <-ui.Callbacks:
			callback()
		case <-ui.Redraw:
-- 
2.43.0

[aerc/patches] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CZ9CFA5921Z3.1G9IJA3WQQSYQ@fra02>
In-Reply-To
<20240219203404.334215-3-robin@jarry.cc> (view parent)
DKIM signature
missing
Download raw message
aerc/patches: SUCCESS in 2m35s

[ipc: fix deadlock when aerc is not running][0] from [Robin Jarry][1]

[0]: https://lists.sr.ht/~rjarry/aerc-devel/patches/49684
[1]: robin@jarry.cc

✓ #1153647 SUCCESS aerc/patches/openbsd.yml     https://builds.sr.ht/~rjarry/job/1153647
✓ #1153646 SUCCESS aerc/patches/alpine-edge.yml https://builds.sr.ht/~rjarry/job/1153646
Details
Message ID
<CZBWKRPXQZT8.3RPEPQPHQXUXD@timculverhouse.com>
In-Reply-To
<20240219203404.334215-3-robin@jarry.cc> (view parent)
DKIM signature
pass
Download raw message
On Mon Feb 19, 2024 at 2:35 PM CST, Robin Jarry wrote:
> Defer the execution of failed IPC commands *after* the IPC socket has
> been unblocked.
>
> Fixes: fd4dd4240885 ("ipc: wait for app to be ready before accepting commands")
> Fixes: https://todo.sr.ht/~rjarry/aerc/229
> Reported-by: Skejg <grolleman@zoho.com>
> Signed-off-by: Robin Jarry <robin@jarry.cc>
> ---

Hey Robin -

This makes sense to me, and admittedly took me way too long to figure out what
was happening.

Reviewed-by: Tim Culverhouse <tim@timculverhouse.com>
Details
Message ID
<CZBXF55T936M.33URVCHP7BDI9@ringo>
In-Reply-To
<CZBWKRPXQZT8.3RPEPQPHQXUXD@timculverhouse.com> (view parent)
DKIM signature
pass
Download raw message
Tim Culverhouse, Feb 22, 2024 at 21:50:
> On Mon Feb 19, 2024 at 2:35 PM CST, Robin Jarry wrote:
> > Defer the execution of failed IPC commands *after* the IPC socket has
> > been unblocked.
> >
> > Fixes: fd4dd4240885 ("ipc: wait for app to be ready before accepting commands")
> > Fixes: https://todo.sr.ht/~rjarry/aerc/229
> > Reported-by: Skejg <grolleman@zoho.com>
> > Signed-off-by: Robin Jarry <robin@jarry.cc>
> > ---
>
> Hey Robin -
>
> This makes sense to me, and admittedly took me way too long to figure out what
> was happening.
>
> Reviewed-by: Tim Culverhouse <tim@timculverhouse.com>

Applied. Thanks!
Reply to thread Export thread (mbox)