Skip to content

Run Explorer changes one at a time instead of refusing the second - #634

Merged
yansfil merged 2 commits into
mainfrom
fix/flaky-630
Oct 6, 2026
Merged

yansfil merged 2 commits into
mainfrom
fix/flaky-630

Conversation

@yansfil

@yansfil yansfil commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Refs #630

Summary

An Explorer change asked while another was still running was refused as busy, with nothing logged and nothing on screen, so the operator's action was lost.
The S3 Explorer test hit it on Windows: it drops renamed.ts on dest and then trashes dest, the page sends the trash without waiting for the drop to land, and on the Windows runner the move took 295 ms, so the trash arrived 10 ms before the move settled and was dropped.
The first attempt's hided log shows the move (operation 6) and no trash request at all; the retry passed because the trash happened to arrive after the move.

The core now runs Explorer changes one at a time in the order they were asked:

  • A change asked while another runs waits in the core (request_explorer_change, runtime/session.rs) and starts when the running one settles, planned against the checkout in front at that moment.
  • At most four wait; a fifth is refused with an explorer.busy diagnostic.
  • A change that fails or is refused drops the waiting ones with one explorer.queue_dropped diagnostic, because they may rely on it (a rename, then a move of the renamed item) and the operator has not seen the failure. A waiting change whose checkout is no longer in front when its turn comes is dropped the same way.
  • The queue is core state only. The snapshot wire, the page and the e2e spec are unchanged.

No screenshots: nothing on screen changes except that the asked-for change now happens.

Review

  • herdr-core/src/runtime/session.rs: runtime mutex and failure path. The next change is planned and its worker started inside the settle of the one before, under the same lock; planning is lexical and reads nothing from disk, as before, and the host call stays on the worker. A start that is refused at its turn (device helper gone, path outside the checkout) settles the slot as refused the existing way and drops the rest.
  • Ownership: the owner is checked when a waiting change's turn comes, not at the moment the front checkout changes. Switching away and back before the running change settles lets the waiting ones run in the checkout they were asked in. Hooking every place the front checkout changes seemed worse than this; say if you want the stricter rule.
  • Snapshot: a waiting change starts in the same step that settles the one before it, so the page can see one change working and then the next working without the first ever finished. The page then skips that change's own folder re-read (ExplorerTree.tsx re-reads on each settled id); the folder watch and device stamping refresh those folders the way they do for a change made outside hide. The selection is not lost: the core sets selected_path on every success and the tree follows it. Nothing on the wire was added for this; docs/UI_BEHAVIOR.md states it.
  • Question: is four the right cap? A drag and the keys after it queue one or two.

Evidence

  • Cause: run 37444894293 (PR Give hide browser a per-command budget for frames that never answer #627 merge ref 48057a2), Windows web e2e, first attempt's hided log: path_move id 6 settled, no path_trash requested; retry log: move id 6 then trash id 7.
  • Before the fix, the four new core tests in herdr-core/src/runtime/tests/documents.rs fail on the test-only commit cb3bbd5: run 37450422332, Rust workspace lane, 1783 tests run: 1779 passed, 4 failed (all four on both tries; the three that wait time out at 5 s, the cap test counts 0 explorer.busy)
  • With the fix (4ecf453): run 37451194749, Rust workspace lane 1802 tests run: 1802 passed, the four on the first try; Linux web e2e 4 shards 185 passed, 0 flaky, s3.spec.ts:726 (the test in Flaky test: the Explorer creates, renames, moves and trashes entries #630) passed on the first attempt. The Windows web e2e first failed before any test, on a GitHub server error while downloading the pinned Herdr; its rerun passed 36, 0 flaky, s3.spec.ts:726 on the first attempt (12.4 s).
  • Tests: a trash asked while a move runs waits and runs; past four waiting the newest is refused and logged; a waiting change whose item went fails at its row and drops the rest; waiting changes are dropped when the checkout in front changes.
  • Not run locally: the machine had no disk room for a Rust build, so CI was the build. One green run does not prove the Windows race is gone; the core tests prove the order.

A trash asked while a move is still running is refused as busy today,
with nothing logged and nothing on screen. These tests state the order
the change should keep, the cap on waiting changes, a waiting change
whose item went, and waiting changes whose checkout left the front.
They fail until the queue lands.

Refs #630
The page sends an Explorer change without waiting for the one before it,
so a trash pressed while a drop was still moving its file was refused as
busy with nothing logged and nothing on screen, and the folder stayed.

A change asked while another runs now waits in the core and starts when
the running one settles, planned against the checkout in front then.
At most four wait; a fifth is refused and logged as explorer.busy. A
failed or refused change, or a checkout that left the front, drops the
waiting ones with one explorer.queue_dropped diagnostic. The queue is
core state only; the snapshot still carries just the running change.

Refs #630
@yansfil
yansfil marked this pull request as ready for review October 6, 2026 10:32
@yansfil
yansfil merged commit 2ca4abf into main Oct 6, 2026
35 of 37 checks passed
@yansfil
yansfil deleted the fix/flaky-630 branch October 6, 2026 11:08
@yansfil yansfil changed the title Run an Explorer change asked while another runs after it, in order Run Explorer changes one at a time instead of refusing the second Oct 6, 2026
yansfil added a commit that referenced this pull request Oct 8, 2026
Related: yansfil/sasu#30 (`/ship merge`가 이 검사를 매 머지마다 돌리고 출력을 보여 주게 하는
쪽)

## Summary

Hide와 GitHub은 PR과 이슈를 `Closes #N` 같은 closing keyword로만 잇는데, 10-06~07에
이슈를 끝낸 PR 7개(#607 #612 #614 #622 #631 #634 #712)가 이 줄 없이 머지됐고 이슈는 손으로 닫혀
연결이 남지 않았습니다.
이제 `scripts/premerge-check.py`가 닫는 이슈가 없는 PR에 머지 명령 바로 위에서 알림을 한 줄 찍습니다.
막지는 않습니다. 이슈 없이 시작한 PR(PRD 작업, CI·문서 변경)도 많기 때문입니다.

```
note: #454 closes no issue. If it finishes one, put `Closes #<issue>` on the body's Closes line before merging (editing the body does not rerun `verify`); with no issue, merge as it is.
#454 may merge now: gh pr merge 454 --merge --match-head-commit a1eda76...
```

## Review

- **판단해 주세요**: 알림만 하고 막지 않는 수준이 맞는지. 막으려면 "이슈 없음"을 PR 본문에 명시하는 규칙이 따로
필요합니다.

## Evidence

- **확인한 것**: 실제 PR로 실행. 이슈를 닫는 #781에는 알림 없음, 닫는 이슈가 없는 #454에는 위 알림이 찍히고
머지 가능 판정은 그대로.
- **확인한 것**: `test_premerge_check.py`에 알림 유무 테스트 1개 추가, `scripts/tests`
206개 통과, `check-no-attribution` 통과.
- **확인하지 못한 것**: PR을 만드는 순간의 알림은 없습니다. 머지 직전에만 알려서, 그때 본문을 고치는 흐름입니다.
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.

1 participant