Skip to content

Conversation

@wangmm0220
Copy link
Contributor

@wangmm0220 wangmm0220 commented Jan 28, 2026

Description

Issue(s)

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 28, 2026 11:26
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @wangmm0220, 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 resolves a bug where TMQ consumers failed to decode heartbeat messages correctly. The fix involves two key changes: including the tmsg.h header to support necessary message handling, and updating the internal connection type for TMQ consumers from a specialized TMQ type to a more general query type. This ensures that consumers establish the appropriate connection, enabling proper processing of heartbeat messages and preventing decoding errors.

Highlights

  • Header Inclusion: The tmsg.h header file has been added to clientTmq.c, indicating that new message-related functionalities are now being utilized.
  • Connection Type Correction: The connection type for TMQ consumers has been changed from CONN_TYPE__TMQ to CONN_TYPE__QUERY when establishing an internal connection. This correction is crucial for addressing issues with how consumers connect and process messages, specifically heartbeat messages.

🧠 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

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 updates the TMQ client so that consumer connections are treated as regular query connections, addressing heartbeat message decoding issues when a consumer is present.

Changes:

  • Added tmsg.h to clientTmq.c so TMQ client code has direct access to message/heartbeat-related structures and definitions.
  • Updated tmq_consumer_new to call taos_connect_internal with CONN_TYPE__QUERY instead of CONN_TYPE__TMQ, so the server and heartbeat pipeline treat TMQ consumer connections as standard query connections.

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

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 addresses a heartbeat decoding error in TMQ consumers by changing the connection type from CONN_TYPE__TMQ to CONN_TYPE__QUERY. This change appears to be a correct and necessary fix to align with server expectations for heartbeat messages. The addition of the tmsg.h header is also appropriate given its usage in the file. I have one suggestion to add a comment explaining the connection type change to improve code maintainability.


// init connection
code = taos_connect_internal(conf->ip, user, pass, NULL, NULL, conf->port, CONN_TYPE__TMQ, &pTmq->pTscObj);
code = taos_connect_internal(conf->ip, user, pass, NULL, NULL, conf->port, CONN_TYPE__QUERY, &pTmq->pTscObj);
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

To improve maintainability, it's helpful to add a comment explaining why CONN_TYPE__QUERY is used instead of CONN_TYPE__TMQ. This clarifies that the change is a deliberate fix for a heartbeat decoding issue and prevents accidental reversions in the future.

  // Use CONN_TYPE__QUERY to ensure compatibility with server heartbeat responses.
  // Using CONN_TYPE__TMQ can lead to decoding errors.
  code = taos_connect_internal(conf->ip, user, pass, NULL, NULL, conf->port, CONN_TYPE__QUERY, &pTmq->pTscObj);

@guanshengliang guanshengliang merged commit 7a9ff32 into 3.3.8 Jan 29, 2026
16 of 17 checks passed
@guanshengliang guanshengliang deleted the fix/6741681950-338 branch January 29, 2026 01:58
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