V3 shared diagnostics server drops required partial response before end in long generic check

Open
#32,718 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
22/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
c, linux
Domain
devtools

Research direction

Start with vlib/v/diagserver/diagserver_linux.c.v, specifically diagserver.Request.print_diagnostics and its exit_code_within(r.diagnostics.pid, partial_answer_ms) check with the 3 ms window. Run ./v -gc none -path vlib -enable-globals -silent vlib/v/compiler_tests/vls_line_info_test.v and instrument the child PID, timing, and partial callback registration to see why the partial marker is missing. Done means the test passes with the partial-before-end ordering preserved, without weakening the assertion or just raising the timeout.

Written by the indexing model from the issue text.

Description

Executed master CI failure (V3 diagnostics streaming, not parser error)

  • Failing master c5d66aae3bc4865f2d18c6c225fc94e2ac374606, V3 unit-tests job 136951934058, completed 2026-11-21 20:08 UTC. Out of 405 V3 test files, only vlib/v/compiler_tests/vls_line_info_test.v failed; the other three V3 unit shards passed.
  • Test test_a_shared_server_sends_the_errors_of_a_long_check_before_its_end around line2219 expects a response marker v-diagnostics-server: partial 1 t\n when V_DIAGNOSTICS_SHARED=1 and V_DIAGNOSTICS_PARTIAL=1. It got the valid immediate compiler error main.v:408:12: operator '+' cannot concatenate 'int' and 'string' followed by v-diagnostics-server: end 1 t, without the partial marker. The test lasted ~53s. Not a GitHub job timeout or intentionally failing fixture; the invalid source is expected and checks that diagnostics stream before the completion of generic-heavy validation.
  • Repro: ./v -gc none -path vlib -enable-globals -silent vlib/v/compiler_tests/vls_line_info_test.v. Fixture blob 9f0179a66ac0b44cb33d5843c9fa29251590f73c identical failing revision and current master 9621aa02fd7d7788700846e93242d08bd70a8aea. vlib/v/diagserver/diagserver_linux.c.v blob bea97b64728a6462ef736bf2a0ab78ab872c2409 also unchanged.

Narrowed source-level discriminator

diagserver.Request.print_diagnostics calls exit_code_within(r.diagnostics.pid, partial_answer_ms) (currently 3 ms) only if r.partials && r.partial != nil && r.token != ''. On the “not exited within 3ms” path it calls the partial callback, flushes stdout/stderr and emits the exact marker; otherwise it prints the final output only. The observed missing marker can mean the grandchild had already exited at that probe, the callback was not registered or the partial flag/token wasn't propagated — none proven by the job log, which records the whole test duration, not the grandchild duration.

Next precise investigation / safe repair

Instrument child PID, check start/finish time, exit_code_within outcome, Request.partials/token and callback registration plus worker scheduling on Linux native V. Verify the fixture still makes the grandchild genuinely long enough to require partial output, separately from startup time; check a failing and passing execution. Preserve BOTH the exact partial-before-end ordering invariant and the error content. If the early-completion path is legitimate, devise a deterministic synchronization/barrier for the test rather than blindly increasing 3ms or accepting a missing partial. After a proven minimal correction, ./v self, format, focused vls_line_info_test.v and original four-shard V3 unit run on a patched descendant. Do not skip/weaken the streaming assertion.

Status R368 unresolved / investigating / still applicable. Local V compiler and formatter were unavailable; no patched V validation or speculative change claimed.

Dominant language
V
Stars
38.1k
Forks
2.3k
Avg merge
1d 1h
Merged PRs (30d)
682

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vlang/v

All issues in vlang/v

Similar issues

More DevTools issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.