Skip to content

fix(client-async): Harden USK datehint resume and cancel handling#1080

Open
leumor wants to merge 2 commits intorelease/2from
bugfix/usk-datehint-resume-retry-guards
Open

fix(client-async): Harden USK datehint resume and cancel handling#1080
leumor wants to merge 2 commits intorelease/2from
bugfix/usk-datehint-resume-retry-guards

Conversation

@leumor
Copy link
Collaborator

@leumor leumor commented Feb 26, 2026

Summary

  • harden USKInserter datehint terminal callback handling for restart/resume windows so terminal events are not lost while phase state is being rebuilt
  • keep callback identity consistent by forwarding transitioned child state on terminal success/failure
  • add guards so stalled datehint retry does not restart after explicit parent cancellation and avoid null-sensitive parent cancellation checks
  • improve callback null-safety paths and tighten helper logic used by the datehint watchdog/resume flow
  • extend USKInserterTest with regression coverage for resume race windows, transitioned-state forwarding, watchdog behavior, and cancel-vs-retry guard paths

How to test

  • run ./gradlew test --tests '*USKInserterTest'
  • run ./gradlew test

Notes

  • base branch for this PR is release/2 (as requested).
  • branch: bugfix/usk-datehint-resume-retry-guards

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 188461b14d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Carry the watchdog-cancel marker in DateHintTerminalCallback and restore it when rebuilding datehint phase state during resume.

Add regression coverage to verify watchdog cancellation survives phase rebuild across resume.
@leumor
Copy link
Collaborator Author

leumor commented Feb 27, 2026

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8346f183ba

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +260 to +261
retryOnStallCancel = false;
completedBeforePhaseRestore = true;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Retry stalled datehint failures during resume race

When a persistent request restarts and a terminal callback arrives before onResume() rebuilds activeDateHintPhase (awaitingPhaseRestore path), this block forces retryOnStallCancel to false. In that timing window, a watchdog-triggered CANCELLED failure is forwarded immediately even if retry budget remains, so stalled datehint phases that should get one retry fail permanently after restart.

Useful? React with 👍 / 👎.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
57.3% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

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