Skip to content

CDC runner: the consumer drains until the producer is done (flaky cdc-multi-clock-test) - #210

Open
junjihashimoto wants to merge 2 commits into
mainfrom
fix/cdc-consumer-drain
Open

junjihashimoto wants to merge 2 commits into
mainfrom
fix/cdc-consumer-drain

Conversation

@junjihashimoto

@junjihashimoto junjihashimoto commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

cdc-multi-clock-test (IP Tests, core-dsl) intermittently reports "Messages sent: 1024, received: 0". It failed on the v0.2.2 candidate (IP Tests 47253263955, attempt 1) and on the PR208 push run (47234132422, attempt 1).

Cause. c_src/cdc/cdc_runner.cpp:

Change. After its loop, the consumer keeps draining until producer_done is set, then does one final sweep. This cannot deadlock: the queue keeps being emptied, and the producer sets producer_done after its last push. Messages that arrive after the consumer's cycles are applied as inputs and counted, exactly as the existing drain did.

Check. A stress harness calls cdc_run with stub domains, 200k/100k cycles, interval 2 (the test's settings):

runner 1 CPU (taskset -c 0) 2 CPUs 12 CPUs
main 40/40 runs received 0
this PR 0/40 bad 0/40 bad 0/40 bad

Here "bad" means received is 0, or received differs from sent.

Also (9b15380): ip-tests.yml now runs on c_src/** changes. The JIT runtime and the CDC runner live there, and before this commit IP Tests did not run on this PR at all.

… barrier only ensures both threads start; on one CPU the consumer finished its cycles and drained before the producer pushed anything: sent 1024, received 0, 40/40 runs; with this change 0/40 on 1, 2 and 12 CPUs)
…C runner live there; #210 changed cdc_runner.cpp and IP Tests did not run)

This branch has not been deployed

No deployments
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