Android recording cleanup stays pending after the recorder PID is reused
Les mainteneurs répondent en général sous 1 jour
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 25/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- À l'abandon
- Stack technique
- android, typescript
Piste de recherche
Read packages/platform-android/src/recording/chunks.ts and cleanup.ts, then inspect the Android recording transport fixture and recovery-cleanup.test.ts matrix referenced in the issue. Trace how ownership-lost and path-writer results affect cleanup. Done means cleanup succeeds for a reused PID with a conclusive empty writer scan, never signals the replacement process, and retains evidence when inspection is inconclusive or a writer remains.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Problem
An Android recording can remain stuck in cleanup after its recorder has already exited. Android may assign that process number to another app or system process before the recording is closed or recovered. Cleanup treats that unrelated process as an unresolved recording owner and refuses to remove the old recording's files and marker. Retrying cleanup does not help while the replacement process remains alive. Users can be left with retained recording state and a device claim that cannot be released normally.
Reproduction path
- Start an Android recording, then leave unfinished recording state after the native recorder exits, for example after a daemon interruption or a failed stop.
- Let Android reuse the recorded PID for an unrelated process while the recording's manifest and artifact remain.
- Close or recover that recording, entering
screenRecordingCleanupwith its valid persisted envelope. - Observe
cleanup-pending/transport-faileddespite the original recorder being gone and no process writing its artifact.
A deterministic host-only regression can use the existing Android recording transport fixture: return ownership-lost from stop and inspect for the persisted identity, and a conclusive empty writer scan for its path. Assert cleanup succeeds without signaling the replacement PID. This reproducer has not been executed here. PID reuse is an ordinary OS event, but its frequency in this exact cleanup window is uncertain.
Evidence
src/platform-runtime-screen-recording-android-host.ts:173-180identifies a PID whose command no longer matches asownership-lost; the replacement can be completely unrelated to recording.packages/platform-android/src/recording/chunks.ts:228-233throws immediately on that stop result, before any path-writer check.packages/platform-android/src/recording/cleanup.ts:17-27calls that stop routine and converts its exception into pending cleanup, so it never removes the old artifact or manifest.packages/platform-android/src/recording/chunks.ts:257-263also throws when a poll establishes that the original process identity has terminated through reassignment.- Read
e41da2338fand itspackages/platform-android/src/recording/recovery-cleanup.test.tstest matrixdirect cleanup checks a reused PID and path writers when %s. Theemptycase proves cleanup without signaling the replacement; the inconclusive and foreign-writer cases correctly retain evidence. Admission-release and successor cases in that test depend on archive-only machinery and are not required for this issue.
Suggested minimal fix and completion conditions
In exact-evidence cleanup, distinguish termination of the original process from continued ownership of its numeric PID. When reassignment is confirmed, require a conclusive empty writer scan for the artifact before deleting it. Never signal the replacement process. Retain evidence if identity inspection or writer enumeration is inconclusive, or if any writer remains. Verify successful cleanup for a reused unrelated PID and refusal for a real path writer.
Estimated clean scope: roughly 40–80 production lines in Android recording chunks/cleanup, plus three or four focused transport-fixture cases. Do not port device-wide admission or change normal export behavior to implement this fix. Dependencies: none; main already exposes identity inspection and path-writer probing.
Relevant archive commit: e41da2338f0e3ff4663548df59c920cc78327daf. Its cleanup caller uses rollbackChunks through earlier archive changes; adapt the behavior to main's cleanupVerifiedAndroidEvidence rather than cherry-picking it unchanged.
Likelihood: plausible after delayed cleanup or daemon interruption on busy devices; uncommon in short uninterrupted recordings. Confidence: high in the cleanup failure, medium in practical incidence.
- Langage dominant
- TypeScript
- Étoiles
- 5.3k
- Forks
- 377
- Merge moyen
- 14 h 6 min
- PR mergées (30 j)
- 650
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de callstack/agent-device
-
Difficulté 2/5 1-3 heures Accessibilité débutants 79/100
callstack/agent-device#4249 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
bug ready-for-agent
Difficulté 2/5 1-3 heures Accessibilité débutants 90/100
callstack/agent-device#4212 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
iOS alert wait: the last poll can get ~30 ms and turns "no alert" into a failed readPeut-être pris @pcbeingused333 l’a pris il y a 6 jours. Ouvertebug ready-for-agent
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
callstack/agent-device#4018 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
callstack/agent-device#1869 ·
Les mainteneurs répondent en général sous 1 jour
-
bug ready-for-agent
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
callstack/agent-device#4247 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de callstack/agent-device
Issues similaires
-
Navbar avatar and name stay stale after saving profile changesPeut-être pris @alexechoi l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
marmelab/atomic-crm#416 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
epam/ai-dial-react-file-manager#99 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
canonical/craft-actions#146 ·
Les mainteneurs répondent en général sous 2 jours
-
feature-request
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
bluesky-social/social-app#12343 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
lucide-icons/lucide#5165 ·
Les mainteneurs répondent en général sous 1 jour