From 86749479c014e140f87bafd57afcc7b5e614bb12 Mon Sep 17 00:00:00 2001 From: Adrien Didot Date: Tue, 8 Sep 2026 12:59:24 +0200 Subject: [PATCH 1/2] fix: make cancelled component worker cleanup idempotent --- .../release-verification.md | 27 ++++++++++++++++--- web-audio-component/runner.py | 5 +++- web-audio-component/tests/test_boundaries.py | 14 ++++++++++ 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/openspec/changes/add-event-multiplatform-link-import/release-verification.md b/openspec/changes/add-event-multiplatform-link-import/release-verification.md index 65f5058..dd934b0 100644 --- a/openspec/changes/add-event-multiplatform-link-import/release-verification.md +++ b/openspec/changes/add-event-multiplatform-link-import/release-verification.md @@ -76,6 +76,27 @@ Hosted Release Pin run `34215403784` rebuilt both corrected archives. The Deezer was unchanged; the web-audio manifest was replaced wholesale with the hosted artifact (77,656,560 bytes, SHA-256 `40b766dfe2e4c62edc828bab023103e79d6588e8be3dc785843ca665fc267ba0`). -Task 7.1 remains open until the hosted builds and public release downloads have -been verified. The release tag must not be created while a manifest or archive -comparison fails. +Final preflight [34216084549](https://github.com/Adridot/syncbox/actions/runs/34216084549) +passed on `3d19a95`. Both applications passed the complete packaging scanner; +the three ZIPs were byte-identical across the isolated roots. The application +ZIP SHA-256 was `6b5f1ca3c21acd69ae30340aefe177e4010764d214379a92e8a39697a5edb01c`; +both component hashes matched the committed manifests. The hosted run passed +814 backend tests (11 skipped), 145 UI tests and all 33 web-audio tests. +CI, all CodeQL language checks and Release Pin were green before merging PR #59. + +The squash merge `8177383e7de08e966c9754c3179066f9201a161b` has the same tree as +the validated branch. Version checks passed again on `master`. A new annotated +`v0.9.0` tag was pushed on that exact commit, triggering +[release run 34217432908](https://github.com/Adridot/syncbox/actions/runs/34217432908). +That attempt failed in the real cancellation test before publication. The +cancellation signal handler stopped the process group, then the `finally` +block stopped it again. macOS returned `EPERM` during the second cleanup. +The release run was cancelled; no GitHub Release or asset was published. + +The follow-up removes the duplicate cleanup and tolerates a group permission +error only when the leader is already reaped, retaining failure for a live +leader. All 35 web-audio tests and five consecutive real cancellation tests +passed locally. The existing `v0.9.0` tag still points to the original merge; +the corrected component requires a new hosted pin and release validation. +Task 7.1 remains open pending the owner's tag/version decision, successful +publication and independent public download verification. diff --git a/web-audio-component/runner.py b/web-audio-component/runner.py index c4f54a5..d6db181 100644 --- a/web-audio-component/runner.py +++ b/web-audio-component/runner.py @@ -271,6 +271,10 @@ def stop_group(process): os.killpg(process.pid, signal.SIGTERM) except ProcessLookupError: return + except PermissionError: + # macOS may report EPERM for a group that has already finished. + if process.poll() is None: + raise try: process.wait(timeout=1) except subprocess.TimeoutExpired: @@ -295,7 +299,6 @@ def supervise(request): process = subprocess.Popen([*command, "--worker"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, start_new_session=True) def cancel(signum, frame): - stop_group(process) raise ComponentError("operation_cancelled") previous_handlers = {sig: signal.getsignal(sig) for sig in (signal.SIGTERM, signal.SIGINT)} for sig in previous_handlers: diff --git a/web-audio-component/tests/test_boundaries.py b/web-audio-component/tests/test_boundaries.py index a40a1d9..4bdbf71 100644 --- a/web-audio-component/tests/test_boundaries.py +++ b/web-audio-component/tests/test_boundaries.py @@ -8,6 +8,7 @@ import time from io import BytesIO from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer +from types import SimpleNamespace from urllib.request import build_opener, ProxyHandler, Request import pytest @@ -101,6 +102,19 @@ def stalled_worker(*args, **kwargs): assert processes[0].poll() is not None +@pytest.mark.parametrize("returncode", [0, None]) +def test_group_permission_error_is_tolerated_only_after_exit(monkeypatch, returncode): + process = SimpleNamespace(pid=123, poll=lambda: returncode, wait=lambda timeout: returncode) + def refused_signal(*args): + raise PermissionError("synthetic group cleanup race") + monkeypatch.setattr(runner.os, "killpg", refused_signal) + if returncode is None: + with pytest.raises(PermissionError): + runner.stop_group(process) + else: + runner.stop_group(process) + + def test_supervisor_signal_cancels_worker_and_grandchild(tmp_path): ready = tmp_path / "ready" orphan = tmp_path / "orphan" From 211d1898f2f423ae4e014b3d9631e175bbda1e36 Mon Sep 17 00:00:00 2001 From: Adrien Didot Date: Tue, 8 Sep 2026 13:10:04 +0200 Subject: [PATCH 2/2] Pin corrected web audio component for 0.9.0 release --- .../release-verification.md | 13 +++++++++++-- sidecar/src/syncbox/web_audio_component.json | 4 ++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/openspec/changes/add-event-multiplatform-link-import/release-verification.md b/openspec/changes/add-event-multiplatform-link-import/release-verification.md index dd934b0..6c7aa7f 100644 --- a/openspec/changes/add-event-multiplatform-link-import/release-verification.md +++ b/openspec/changes/add-event-multiplatform-link-import/release-verification.md @@ -98,5 +98,14 @@ error only when the leader is already reaped, retaining failure for a live leader. All 35 web-audio tests and five consecutive real cancellation tests passed locally. The existing `v0.9.0` tag still points to the original merge; the corrected component requires a new hosted pin and release validation. -Task 7.1 remains open pending the owner's tag/version decision, successful -publication and independent public download verification. +The owner explicitly authorized recreating the unpublished `v0.9.0` tag on +2026-09-08, retaining version 0.9.0. The replacement will use an exact remote +tag lease after the corrected hosted preflight passes. This is an authorized +exception for the failed, unpublished release; published release tags remain +immutable. Task 7.1 remains open pending successful publication and independent +public download verification. + +Hosted Release Pin run `34218397887` rebuilt the corrected component. Both +generated manifests were downloaded and installed whole; the Deezer pin was +unchanged. The corrected web-audio archive is 77,656,556 bytes, SHA-256 +`61a85eef7ced0ae7788a53acbea8ad0b3d9788926acd1822efff65f0882fe880`. diff --git a/sidecar/src/syncbox/web_audio_component.json b/sidecar/src/syncbox/web_audio_component.json index b015bab..386920e 100644 --- a/sidecar/src/syncbox/web_audio_component.json +++ b/sidecar/src/syncbox/web_audio_component.json @@ -4,8 +4,8 @@ "protocol_version": 1, "platform": "macos-arm64", "archive": "syncbox-web-audio-component-0.9.0-macos-arm64.zip", - "size": 77656560, - "sha256": "40b766dfe2e4c62edc828bab023103e79d6588e8be3dc785843ca665fc267ba0", + "size": 77656556, + "sha256": "61a85eef7ced0ae7788a53acbea8ad0b3d9788926acd1822efff65f0882fe880", "license_inventory_complete": true, "component_version": "0.9.0", "root": "syncbox-web-audio-component",