Skip to content

chore: honor kbagent action retry policy#10361

Merged
leon-ape merged 2 commits into
mainfrom
bugfix/kbagent-reconfigure-timeout-retry
Jun 23, 2026
Merged

chore: honor kbagent action retry policy#10361
leon-ape merged 2 commits into
mainfrom
bugfix/kbagent-reconfigure-timeout-retry

Conversation

@weicao

@weicao weicao commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Problem

kbagent action service only used req.RetryPolicy when executing actions. The action-level retryPolicy declared in the Action definition was registered into the action table but never consulted at call time.

This makes the addon-side pattern exit non-zero + retryPolicy unreliable — the reconfigure path passes runtime ReconfigureArgs but not a request-level retry policy, so an action-level retryPolicy was ineffective on this path. The same issue affected non-blocking calls.

Solution

  • Resolve retry policy the same way timeout is resolved: request-level overrides action-level; otherwise action-level is used.
  • Apply retry handling to non-blocking calls without runtime arguments as well.

Validation

Unit tests pass on head 4ef8731d82df59e58bd2c2ba7fff9c99d1480ee0:

go test ./pkg/kbagent/... -count=1

Test cases cover:

  • Action retry policy used when request retry policy is absent
  • Request retry policy overrides action retry policy
  • Retry policy applied to non-blocking calls without runtime arguments

Boundary

This PR only changes action-level retry policy resolution in kbagent. It does not change maxActionCallTimeout, CRDs, or API docs.

@apecloud-bot

Copy link
Copy Markdown
Collaborator

Auto Cherry-pick Instructions

Usage:
  - /nopick: Not auto cherry-pick when PR merged.
  - /pick: release-x.x [release-x.x]: Auto cherry-pick to the specified branch when PR merged.

Example:
  - /nopick
  - /pick release-1.1

CLA Recheck Instructions

Usage:
  - /recheck-cla: Trigger a re-check of CLA status for this pull request.
Example:
  - /recheck-cla

@github-actions github-actions Bot added the size/L Denotes a PR that changes 100-499 lines. label Jun 11, 2026
@weicao weicao force-pushed the bugfix/kbagent-reconfigure-timeout-retry branch from 648424a to 2225d3b Compare June 19, 2026 12:29
@weicao

weicao commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

/nopick

@apecloud-bot apecloud-bot added the nopick Not auto cherry-pick when PR merged label Jun 19, 2026
@weicao weicao force-pushed the bugfix/kbagent-reconfigure-timeout-retry branch from 2225d3b to 52094ef Compare June 19, 2026 12:36
@weicao weicao changed the title fix: honor kbagent action retry policy chore: honor kbagent action retry policy Jun 19, 2026
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.07%. Comparing base (e296fcd) to head (4ef8731).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10361      +/-   ##
==========================================
+ Coverage   61.85%   62.07%   +0.22%     
==========================================
  Files         533      533              
  Lines       63621    63678      +57     
==========================================
+ Hits        39354    39531     +177     
+ Misses      20672    20556     -116     
+ Partials     3595     3591       -4     
Flag Coverage Δ
unittests 62.07% <100.00%> (+0.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@weicao

weicao commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Runtime focused validation completed for the affected Redis reconfigure path.

Scope:

Result:

PASS: 33 / FAIL: 0 / SKIP: 0

Evidence package:

  • redis-pr10361-kbagent-sideload-20260619T2130.tgz
  • sha256: 09df004fddcdcd94e2343f849908a50842642a96fb552ff804bc1873cdfbd378

Identity and action evidence checked:

  • PR source marker: 52094ef6cf666f57a708196638ad1b14a386b0f9
  • /bin/kbagent sha256: e780fe9a2e5ee2ff52daeae71a6cfcb01bcdd1c8e12fc4a1e08b4b27a41f4656
  • Live Redis pods ran init-kbagent from docker.io/library/kubeblocks-tools:pr-10361-52094ef-stella with imageID sha256:b0fcdc5aaeb98f30965165a130e7c4dcf13c995d34151e59e957f6966cabc0de.
  • Pod spec copies /bin/kbagent from the injected tools image into /kubeblocks/kbagent; the action container executes /kubeblocks/kbagent.
  • Live action config contains timeoutSeconds: 120, retryPolicy.maxRetries: 3, and RECONFIGURE_WAIT_TIMEOUT=90.
  • kbagent audit logs show the reconfigure action executed successfully with no timedOut entry.
  • Cleanup evidence shows namespace NotFound and no PV residue.

Caveat:

  • The injected tools containers used imagePullPolicy: IfNotPresent, not Never, because this path is currently hardcoded in the controller.
  • The package does not include node import log files, so the accepted wording is limited to the exact live imageID/content focused gate above. This is not a Redis release-ready or broader matrix claim.

@weicao weicao marked this pull request as ready for review June 19, 2026 14:37
@weicao weicao requested review from a team and leon-ape as code owners June 19, 2026 14:37
@weicao weicao requested review from cjc7373 and wangyelei June 20, 2026 12:55
Comment thread pkg/kbagent/service/action_utils.go Outdated
The action API defines 60s as the maximum synchronous execution timeout.
Revert the constant, API comment, test, and regenerated CRDs/docs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@leon-ape

Copy link
Copy Markdown
Contributor

[P2] The PR description and validation evidence are stale after head 4ef8731. The current diff no longer raises maxActionCallTimeout or updates the Action timeout API/CRD/docs contract, but the Problem/Solution/Validation sections still claim the 120s cap change and cite runtime validation for commit 52094ef. Please update the PR scope and provide evidence for the current head, or narrow the validation claim to the action-level retry behavior only.

@apecloud-bot apecloud-bot added the approved PR Approved Test label Jun 23, 2026
@weicao

weicao commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

Updated PR description for head 4ef8731:

  • Removed stale claims about maxActionCallTimeout 60→120 change (reverted)
  • Removed stale runtime validation citing commit 52094ef
  • Narrowed scope to action-level retry policy resolution only
  • Validation section now cites unit tests on current head

@leon-ape leon-ape merged commit 4933980 into main Jun 23, 2026
37 checks passed
@leon-ape leon-ape deleted the bugfix/kbagent-reconfigure-timeout-retry branch June 23, 2026 06:47
@github-actions github-actions Bot added this to the Release 1.2.0 milestone Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved PR Approved Test nopick Not auto cherry-pick when PR merged size/L Denotes a PR that changes 100-499 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants