Skip to content

Conversation

@dapan1121
Copy link
Contributor

Description

Issue(s)

  • Close/close/Fix/fix/Resolve/resolve: Issue Link

Checklist

Please check the items in the checklist if applicable.

  • Is the user manual updated?
  • Are the test cases passed and automated?
  • Is there no significant decrease in test coverage?

Copilot AI review requested due to automatic review settings January 29, 2026 00:14
@dapan1121 dapan1121 requested review from a team, guanshengliang and hzcheng as code owners January 29, 2026 00:14
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @dapan1121, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily addresses an issue where 'explain' operations might not correctly handle responses, leading to a 'no response' state. It refactors how job contexts and notifications are managed within the scheduler, particularly for parent-child job relationships and explain queries. By introducing a new macro for parent job identification and enhancing task notification logic, the changes ensure proper completion and cleanup of jobs, thereby improving the overall robustness and reliability of the scheduler's handling of complex query types.

Highlights

  • New Macro for Parent Job Identification: Introduced SCH_PARENT_JOB macro in schInt.h to consistently retrieve the top-level parent job, simplifying logic for handling job hierarchies.
  • Enhanced Job Task Notification: Modified schNotifyJobAllTasks in schJob.c to ensure that notifications are correctly propagated to all sub-jobs, improving the robustness of task state management.
  • Refactored Explain Response Handling: Updated functions schProcessFetchRsp, schProcessExplainRsp, and schProcessResponseMsg in schRemote.c to utilize the new SCH_PARENT_JOB and SCH_JOB_EXPLAIN_CTX macros, ensuring the correct explain context and parent job are used when processing responses, which addresses the 'no response' issue.
  • Improved Task Hash List Notification: Added a null check for pCurrTask in schNotifyTaskInHashList within schTask.c, preventing potential issues when a specific task is not provided for notification.
  • Test Command Simplification: Removed redundant ./ci/pytest.sh prefixes from several pytest commands in test/ci/cases.task for cleaner test execution definitions.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request aims to fix an issue where 'explain' queries do not receive a response, likely in scenarios involving sub-queries. The changes introduce helper macros to get the parent job and its explain context, and uses them to centralize explain-related operations. Additionally, task notification logic is updated to handle sub-jobs and allow for null tasks. While most of the changes seem correct, I've found a critical bug in schJob.c where sub-job tasks are not being notified correctly due to a potential copy-paste error. Please see the specific comment for details.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts scheduler handling for EXPLAIN jobs (especially with sub-jobs) and tweaks a CI task list, aiming to fix a “no response” issue during EXPLAIN executions.

Changes:

  • Guard schNotifyTaskInHashList against a NULL current task and extend schNotifyJobAllTasks to propagate notifications to sub-jobs.
  • Introduce SCH_PARENT_JOB and consistently use SCH_JOB_EXPLAIN_CTX / SCH_PARENT_JOB in scheduler remote response handling so EXPLAIN state is tracked on the parent job.
  • Update several entries in test/ci/cases.task for subquery-related tests to use bare pytest instead of the ./ci/pytest.sh wrapper.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/ci/cases.task Adjusts how a set of subquery and related tests are invoked in the CI task matrix.
source/libs/scheduler/src/schTask.c Safely skips direct notification when pCurrTask is NULL before iterating the task hash list.
source/libs/scheduler/src/schRemote.c Routes EXPLAIN context and completion handling through the parent job to ensure results and notifications are attached to the correct job.
source/libs/scheduler/src/schJob.c Extends job-wide task notification to cover sub-jobs, but currently misuses the parent’s task list inside the sub-job loop.
source/libs/scheduler/inc/schInt.h Adds SCH_PARENT_JOB macro and centralizes access to the appropriate EXPLAIN context.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@guanshengliang guanshengliang merged commit af317e4 into 3.0 Jan 29, 2026
19 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants