Skip to content

fix: keep a coordinator per Pi session, not one per process - #96

Open
leohenon wants to merge 1 commit into
nicobailon:mainfrom
leohenon:fix/95-coordinator-per-session
Open

leohenon wants to merge 1 commit into
nicobailon:mainfrom
leohenon:fix/95-coordinator-per-session

Conversation

@leohenon

Copy link
Copy Markdown

In a host that runs several Pi sessions in one process, such as pi-web, all sessions shared one coordinator and one session manager. Notices went to the session that started last, and one session's shutdown killed every session's shells.

Each Pi session now has its own coordinator, and a shutdown ends only the shells that session started. Single-session behaviour is unchanged. The shell list is still shared, so listing, attaching and dismiss-all still reach other sessions' shells.

New tests in tests/multi-session-host.test.ts fail on main. Checked in pi-web: both symptoms reproduce on main and are gone on this branch.

Fixes #95

A host such as pi-web runs several Pi sessions in one process. They shared one coordinator and one session manager, so notices went to whichever session bound its API last, and any session's shutdown killed every session's shells and monitors. Keep a coordinator per session id, record which session started each shell, and on shutdown end only that session's shells. The whole-process teardown still runs when the last session leaves.

Fixes nicobailon#95
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Process-global coordinator/session manager breaks multi-session hosts (notices go to the newest session; one session's shutdown kills all monitors)

1 participant