Skip to content

index refresh and test counts: a refresh beside another process waits while an index the home reads has no packages (mcpp#927); a suite is counted by its cases - #999

Merged
Sunrisepeak merged 3 commits into
mainfrom
fix/927-index-refresh-stale-hint
Nov 22, 2026

Conversation

@Sunrisepeak

@Sunrisepeak Sunrisepeak commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

mcpp#927 item 3 reported a process that ended with no local package index while another was refreshing the index. 2026.11.13.1 made such a process wait for the refresh it skipped when an index it declares is absent (design 2026-11-12 §18 P3), but that judgement differed from the reader's:

  • the reader reports the index absent when <index>/pkgs is missing (index_status_for); the refresh judged a declared index's directory by its existence, so a directory the other process had made and not yet filled let it skip;
  • the provider's own index (xim, data/xim-pkgindex) is read too, and was not judged at all, so a reader beside a first fetch of it skipped.

Changes:

  • index_present is the one judgement of an index's presence: <index>/pkgs. The index status, the refresh marker, the freshness check and the refresh beside another process use it.
  • A refresh that finds the lock held skips only when every index the home reads is present (every_index_present: the provider's own and each declared); otherwise it waits for the lock, as before.
  • tests/unit/test_xlings.cpp (XlingsIndexLock): the test holds the index lock (a second holder in the same process is refused, so no sync is reached) and asserts that a refresh returns at once when every index is present, and waits until the lock is released when a declared index has no packages or the provider's own index is absent. Against the previous code the two waiting cases fail.
  • docs/05-dependencies.md (both languages) states the behaviour; CHANGELOG [Unreleased]; the design record's §18.3 states the change and the check that holds it.

Item 6 of the issue (a hint for mcpp clean --stale) is in place since 2026.11.13.1 (P6): a build whose configuration opens a new directory warns with the size of the one beside it and the command that reclaims it (tests/e2e/cache/directories.cpp).

A suite's count on the program's line

The release's ecosystem check ran mcpp-index's mtest example: its program reported 8 cases on its line and the summary 7 passed. The summary counts a suite run as a case by its cases (a case that declares cases is told by them); the program's line counted every reported case, the suite included.

  • declares_cases is the one judgement; the program's line, the summary and the failures' index use it.
  • Case 1143 (e2e/test, protocol): a program of one suite of two cases and one case alone reads 3 cases on its line and cases: 3 passed in the summary.
… reads has no packages, judged as a reader judges it (mcpp#927)
@Sunrisepeak Sunrisepeak changed the title index: a refresh beside another process waits while an index the home reads has no packages (mcpp#927) Nov 22, 2026
@Sunrisepeak
Sunrisepeak merged commit afafbd1 into main Nov 22, 2026
53 checks passed
@Sunrisepeak
Sunrisepeak deleted the fix/927-index-refresh-stale-hint branch November 22, 2026 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant