Skip to content

[Refactor] Add ExecEnv guardrails and context scaffolding#71299

Merged
alvin-celerdata merged 2 commits intoStarRocks:mainfrom
alvin-celerdata:opt-exec-env
Apr 4, 2026
Merged

[Refactor] Add ExecEnv guardrails and context scaffolding#71299
alvin-celerdata merged 2 commits intoStarRocks:mainfrom
alvin-celerdata:opt-exec-env

Conversation

@alvin-celerdata
Copy link
Copy Markdown
Contributor

Why I'm doing:

What I'm doing:

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
    • This pr needs auto generate documentation
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 4.1
    • 4.0
    • 3.5
    • 3.4

Signed-off-by: alvin-celerdata <alvin.zhao@celerdata.com>
@alvin-celerdata alvin-celerdata requested review from a team as code owners April 4, 2026 15:25
@CelerData-Reviewer
Copy link
Copy Markdown

@codex review

Copy link
Copy Markdown

@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: f2948f8c4c

ℹ️ 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 +359 to +360
ExecEnv::ExecEnv() {
_refresh_service_contexts();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Defer context refresh until members are initialized

Calling _refresh_service_contexts() in the default constructor copies member pointers into the service views before init() assigns them, but ExecEnv still has raw-pointer fields without in-class initialization (notably _lookup_dispatcher_mgr and _cache_mgr in exec_env.h). For non-static ExecEnv instances (including this test pattern), those fields are indeterminate, so this constructor path performs undefined reads and can propagate garbage pointers into runtime_services().

Useful? React with 👍 / 👎.

Signed-off-by: alvin-celerdata <alvin.zhao@celerdata.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

[FE Incremental Coverage Report]

pass : 0 / 0 (0%)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

[BE Incremental Coverage Report]

pass : 78 / 78 (100.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 be/src/runtime/exec_env.cpp 71 71 100.00% []
🔵 be/src/runtime/service_contexts.h 7 7 100.00% []

@alvin-celerdata alvin-celerdata merged commit 58b2015 into StarRocks:main Apr 4, 2026
47 of 49 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.

2 participants