Skip to content

fix(ENG-4588): don't let a late status from a cancelled wait resume it - #264

Merged
vgoat21 merged 1 commit into
stagingfrom
joshuavillaltaesp/eng-4588-stale-wait-event-staging
Nov 16, 2026
Merged

vgoat21 merged 1 commit into
stagingfrom
joshuavillaltaesp/eng-4588-stale-wait-event-staging

Conversation

@vgoat21

@vgoat21 vgoat21 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Fixes the staging failure on the release PR (#219): TestAnalysisLogComponent.testCancelledMonitoringUntracksProgram, which timed out in waitForTasks on Ghidra 12.0.2.

Problem

PR #263 made the analysis wait fire its status events after the current event delivery (fireLater), so that Ghidra would stop dropping them. This created a new race:

  • The Queued status a wait reports can now arrive after the user has cancelled the wait and it has ended.
  • The program is no longer tracked by then, so AnalysisLogComponent treated that status as a new analysis and started another wait.
  • That wait cleared the cancel and kept polling.

In the test, the mock always answers Queued, so the new wait never ended. For users, cancelling the wait could quietly undo itself.

Fix

  • Statuses reported by a running wait carry their own source: RevEngAIAnalysisStatusChangedEvent.WAIT_SOURCE, checked with isFromWait().
  • AnalysisLogComponent no longer starts a wait for these statuses. Only Start Analysis, reopening a program and the like start one.
  • Statuses that end a wait (Complete, Error) are handled as before.

Testing

  • New testStatusFromACancelledWaitDoesNotResumeIt. It cancels a wait, delivers its late Queued, and checks that no wait starts and polling doesn't resume. It fails without the fix, timing out in waitForTasks as on CI.
  • ./gradlew buildExtension passes.
  • ./gradlew test passes: 411 tests, 0 failures.

Since the wait's statuses are fired after the current event delivery
(fireLater), the Queued a wait reported can arrive after the wait has been
cancelled and has ended. With the program no longer tracked,
AnalysisLogComponent took it for a new analysis and started another wait,
which cleared the cancel and polled on. This is what failed
testCancelledMonitoringUntracksProgram on the release PR.

Statuses a wait reports now carry their own source, and never start a
wait: only Start Analysis, reopening a program and the like do.
@vgoat21
vgoat21 requested a review from a team as a code owner November 16, 2026 08:57
@vgoat21
vgoat21 merged commit 8fc86bf into staging Nov 16, 2026
70 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.

3 participants