Skip to content

Fix #1790: discard test poll results from a finished sweep - #1806

Open
4RH1T3CT0R7 wants to merge 1 commit into
throneproj:devfrom
4RH1T3CT0R7:fix-1790-urltest-progress
Open

Fix #1790: discard test poll results from a finished sweep#1806
4RH1T3CT0R7 wants to merge 1 commit into
throneproj:devfrom
4RH1T3CT0R7:fix-1790-urltest-progress

Conversation

@4RH1T3CT0R7

@4RH1T3CT0R7 4RH1T3CT0R7 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

~ResultPoller doesn't join its tick, so a poll in a 30s RPC outlives the sweep that started it. It checks sessionGen_ going in, not coming out, and credits what it drains to the sweep running now. That's the >100% bar: seedLatencyTest() has already zeroed testProgress and the late tick calls addTestProgress() anyway. Quieter half: chain tags are positional and the counter restarts each batch, so a stale tag2entID can write a latency onto the wrong profile.

Fix re-checks sessionGen_ after each query returns, before crediting progress or touching a profile. Dropping a late drain loses nothing, the owning sweep's response carries the full result set.

One gap: sessionGen_ bumps per sweep, not per batch, so past 100 profiles a poll can still misattribute within a sweep. Happy to add a fetch_add in runBatch if you want that too.

Closes #1790

The ResultPoller ticks that drain partial results check sessionGen_ once,
at the top of the tick, and then block in QueryURLTest / QueryIPTest /
QueryCurrentSpeedTests / QueryCountryTestResults. ~ResultPoller only sets
the stop flag and deliberately does not join, so a tick already inside its
RPC outlives the sweep that created it. By the time that RPC returns the
next sweep may have started: seedLatencyTest() has zeroed testProgress, and
the tick then calls addTestProgress() once per result it drained. The new
sweep's counter is credited with the previous run's leftovers, so the panel
shows more than totalProfiles and the percentage runs past 100%. That is why
it reproduces on the second Url Test Selected rather than the first.

The same window misfiles results: BuildTestConfig numbers chain outbounds
positionally (hopTag prefix-1, prefix-2, ...) and restarts the counter for
every batch, so a stale tag2entID resolves a new sweep's tag to whatever
profile held that slot before, and applyUrlResult writes the latency onto
the wrong row.

Re-check sessionGen_ after each query returns, before crediting progress or
touching profiles. No profile data is lost by dropping a late drain: the
owning sweep's Test / IPTest / SpeedTest response carries the full result
set and its final pass applies all of it. The counter is a separate matter -
the final pass never calls addTestProgress, so results a poll never reached
already go uncounted today and the bar can stop short of 100%. This does not
change that; it stops the count from being credited to the wrong run.
pollSpeedTest and pollCountryTest take the generation as an argument since
they run the query themselves.
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.

[Bug]: "Url Test Selected" progress bar exceeds 100%

1 participant