Skip to content

fix: end a dataset's turn and a vector graph's build when their work is done - #68

Merged
MathiasVDA merged 1 commit into
mainfrom
claude/project-thread-dcnodw
Nov 20, 2026
Merged

MathiasVDA merged 1 commit into
mainfrom
claude/project-thread-dcnodw

Conversation

@MathiasVDA

@MathiasVDA MathiasVDA commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Two flaky tests, both from real races in the code:

  • limits.rs dataset_limits (failed on main at 7138bd0, run 44707386746: running was 1, expected 0). A dataset's turn (maxConcurrent) was released only when the request context dropped, after the last bytes of the answer were written. A client that sends its next request as soon as an answer is in could wait for (or with maxQueued 0, be refused for) that turn, and /$/stats could still show it running. The caller's turn already ends at the end of the body (ReleaseAtEnd); the dataset turn now goes with it.
  • vectors.rs a_saved_graph_is_read_again_by_a_new_engine (failed on PR fix(ui): show TripleTrail's plan in MatGUI's Explain tab #67, run 44720484076: remove_dir_all gave DirectoryNotEmpty, leaving a tripletrail-vector-graph-* folder). The background thread marked the graph done (building = false) before it wrote the .hnsw file, so a caller that waited for the status removed the folder while save was still writing .part (and create_dir_all could make it again). The graph now stays "being made" until its file is written. The test uses tripletrail_testdir and checks the file is a graph with no .part left.

How it was tested

  • cargo test -p tripletrail --test vectors (14 passed), the saved-graph test 15 times in a row.
  • cargo test -p tripletrail-server --test limits --test http (6 + 33 passed), dataset_limits 10 times in a row.
  • cargo fmt --check, cargo clippy -p tripletrail -p tripletrail-server --all-targets -D warnings. No tripletrail-* folders left in TMPDIR.

Documentation

  • No user-facing change beyond timing, or:
  • The user guide (docs/guide/) shows it
  • The CHANGELOG entry describes it (Fixed)

…is done

A dataset's turn (maxConcurrent) was released only after the last bytes of
the answer were written, so a client that sent its next request at once
could wait for it, and /$/stats could still show the answer running
(dataset_limits failed on main at 7138bd0). It now ends once the body is
read to its end, as the caller's turn already did.

A vector graph was marked done before it was written to its file, so a
caller that waited for the status could see the folder still written to
(a_saved_graph_is_read_again_by_a_new_engine failed removing it). It now
stays in the making until the file is written. The test uses
tripletrail_testdir.
@MathiasVDA
MathiasVDA merged commit 183879c into main Nov 20, 2026
4 checks passed
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