Skip to content

fix(mo-service): apply max-processor after flag parsing - #32337

Merged
mergify[bot] merged 2 commits into
matrixorigin:mainfrom
aptend:fix/astra-meow-32078
Nov 6, 2026
Merged

mergify[bot] merged 2 commits into
matrixorigin:mainfrom
aptend:fix/astra-meow-32078

Conversation

@aptend

@aptend aptend commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Fixes #32078

What this PR does / why we need it:

An explicit mo-service -max-processor N was read before flag.Parse(), while the registered value was still zero. Move positive-value application after parsing so the existing setter updates both the Go runtime and the cached worker capacity used by the compiler. Omitted, zero and negative values retain the initialized policy.

Add real-main subprocess regressions for lower/higher values, omitted/nonpositive controls, early version exit, the dynamic launcher's generated CPU argument, and a Linux single-CPU affinity control. Extract the dynamic child command without changing its generated arguments.

Validation on Linux/amd64 with CGO enabled and native artifacts from this worktree, against main@dfc3ab0e382d plus the reviewed five-file patch:

  • Causal pre-fix regression failed on ignored positive/dynamic arguments; the same focused regression passes after the fix.
  • .agents/skills/mo-dev/scripts/mo-cgo-test -v -count=1 -timeout=12m ./cmd/mo-service/ returned 0 (169 named RUN entries, 169 PASS, 0 SKIP). The real-main and single-CPU affinity regressions both executed and passed.
  • Repository-pinned make --no-print-directory err-check static-check-selected STATIC_CHECK_PACKAGES=./cmd/mo-service/... returned 0 with no issues. The selection covers the changed command and tests; the import graph has no external importers of this command package.
  • Two fresh private service phases exercised the inherited limit 4 and -max-processor 8. Startup runtime/cache pairs were 4/4 and 8/8. Both executed a deterministic 20,000-row query and returned COUNT=20000, SUM=959289, matching an independent formula. Physical-plan scan budgets were 1 in both phases and remained within the configured capacity; no physical DOP scaling or performance improvement is claimed.
  • After the overridden phase's SQL, QueryService read/set/read returned 8 / previous 8 / 6. Both original service waits returned 0 after TERM, with full TCP/UDP ownership checks and no owned process/socket residue.

Native configuration/source/binary identities and original nonzero attempts were retained. Earlier valid focused, native and static evidence was reused only where its relevant inputs remained unchanged. Hosted CI and review remain separate from these local results.

@aptend
aptend requested a review from XuPeng-SH as a code owner November 6, 2026 11:27
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH

XuPeng-SH commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: 6a37add27989f83c9e60d8ed61d71115e8745555

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

mo-bot review · mo-bot-local · review

Commit: 6a37add27989f83c9e60d8ed61d71115e8745555

Assessment: approve

The parsed positive flag updates runtime and compiler CPU state through the existing setter. Dynamic launch arguments remain equivalent. No actionable correctness or design issues remain.

Model: gpt-6.1-sol / max

Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0

Validation:

  • Reviewed all five changed files, affected owners and consumers, linked issue 32078, and both discussion entries.

  • Linux amd64, Go 1.27.1: cmd/mo-service passed 169 tests/subtests with no failures or skips, including real-main and single-CPU affinity cases.

  • Frozen-base main.go overlay reproduced all four positive-override failures; zero, negative, and version controls passed.

  • Scoped go vet, gofmt, and git diff --check passed. Isolation preflight and native-input qualification passed. Receipts and log hashes are recorded in validation-index.json.

Limitations:

  • Non-Linux execution and the author-reported full-service SQL/RPC smoke were not independently repeated.

  • Initial dependency setup timed out before tests started; offline recovery preceded the successful run.

@mergify mergify Bot added the queued label Nov 6, 2026
@mergify

mergify Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ Merged into main as bfdf875 at 14:40 UTC

1 h 11 min in the queue, 1 h 9 min of it CI.

So far

  • ✅ Entered the queue Fri 6 Nov, 13:29 · rule main · triggered by rule Automatic queue on approval for main
  • ✅ Passed · in place
  • ✅ Merged 14:40 · bfdf875 · squash
3 merge conditions met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • github-review-approved · required by GitHub branch protection
  • any of · required by GitHub branch protection:
    • check-success = CI Required
    • check-neutral = CI Required
    • check-skipped = CI Required

Times in UTC · dashboard · how the merge queue works

This branch was previously deployed

1 inactive deployment
ci — c4a0dde1 Deployed Nov 6, 2026 by mergify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working kind/test-ci size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: mo-service ignores -max-processor because the flag is read before flag.Parse

3 participants