Skip to content

Linux: akou quit can hang after a call ends (G1 gate, 1 of 2 runs) #351

Closed

Description

@GeiserX

On Linux, akou quit sometimes never finishes after a call. The G1 gate caught it once in two runs of the same code (0.6.3, ubuntu-24.04, Xvfb with Openbox).

What the app log shows. In the failing run, the normal start recorded a call, the second hotkey press stopped it (a part ended), and then the gate sent akou quit:

13:08:18.883 info call 01M4B7N642HC3FFXN9E1689700: a part ended
13:08:19.386 info quitting
13:08:19.437 info call 01M4B7N642HC3FFXN9E1689700: ended

The app never logged akou 0.6.3 quit (pid 8881), and runtime.json was still there 30 s later. The gate then ended the launcher after 10 s more.

What it is not. quitting before call ... ended is the normal order: every quit after a call in both runs logs them that way, including the ones that finished in 2 to 60 ms (quit (pid ...) follows ended at once). So the hang is in the part of quit() in src/main/index.ts that runs after manager.quit(). None of those steps logs, so which one stopped is not known. One candidate: when the final pass outlives QUIT_FINAL_GRACE_MS, quit() aborts it and then waits on Promise.allSettled(running) with no deadline, so a final pass that ignores the abort holds the quit forever.

Runs.

Windows passed every phase in both runs.

To fix. Log each step of the quit after the call ends (or at least the final-pass wait), put a deadline on the wait after the abort, and run the G1 gate on Linux a few times to see it hold.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions