Skip to content

Added missing Debug Level testing for "Send Reply Current is 0" #2373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jeteve
Copy link

@jeteve jeteve commented Apr 30, 2025

Does what it says in the title.

I'm also wondering if it is intentional that this TAOLIB_DEBUG statement is not under a debug condition?

NB: Also ignore .devcontainer

Summary by CodeRabbit

  • Chores

    • Updated settings to ignore the .devcontainer directory or file in version control.
  • Bug Fixes

    • Adjusted debug message logging so that certain messages are shown only when debugging is enabled, reducing unnecessary log output.

Copy link
Contributor

coderabbitai bot commented Apr 30, 2025

Walkthrough

The changes include an update to the .gitignore file to exclude the .devcontainer directory or file from version control. Additionally, the Server_Interceptor::send_reply method in the Request_Interceptor.cpp file was modified so that a debug message about a null scheduling context is now only logged when the debug level is set above zero, rather than unconditionally.

Changes

File(s) Change Summary
.gitignore Added .devcontainer to the ignore list to prevent it from being tracked by Git.
TAO/tao/RTScheduling/Request_Interceptor.cpp Modified debug logging in Server_Interceptor::send_reply to respect the TAO_debug_level.

Poem

In the warren of code, a tweak or two,
.devcontainer now hides from view.
Debug logs whisper, but only when told,
By the level set—no stories unfold,
Unless the rabbit’s ears are keen,
On secrets in the scheduling scene.
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e3b027b and 46252a0.

📒 Files selected for processing (2)
  • .gitignore (1 hunks)
  • TAO/tao/RTScheduling/Request_Interceptor.cpp (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (2)
.gitignore (1)

1-1: Appropriate addition to .gitignore

Adding .devcontainer to the gitignore file is a good practice. This prevents development container configurations from being tracked in version control, which is typically environment-specific and not meant to be shared across all developers.

TAO/tao/RTScheduling/Request_Interceptor.cpp (1)

409-416: Good fix - debug message now properly guarded by debug level check

This change properly wraps the "Send Reply Current is 0" debug message with a check for TAO_debug_level > 0, making it consistent with all other debug messages in the file. This addresses the concern raised in the PR description about whether the original unguarded TAOLIB_DEBUG statement was intentional.

The change ensures debug messages only appear when debugging is enabled, giving users better control over logging verbosity.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@mitza-oci
Copy link
Member

wondering if it is intentional that this TAOLIB_DEBUG statement is not under a debug condition?

It may be, see similar statement earlier in this function. If the developer thought this was a very serious warning it could be logged at all levels (users still have control over the logger objects and if/where they output). In this case I'm not sure what the correct behavior is.

@jeteve
Copy link
Author

jeteve commented Apr 30, 2025

Thanks @mitza-oci for looking into it.

Maybe @jwillemsen will have an opinion?

If the warning is serious, I would have expected the macro to be used to be TAOLIB_ERROR instead.

@mitza-oci
Copy link
Member

If Server_Interceptor::receive_request completes successfully (reaches the end without throwing or returning early), the value should not be null when Server_Interceptor::send_reply goes looking for it.

If you have an application that exhibits this behavior it would probably be good to find out why receive_request isn't working, or if there's some other bug. If you can add a test to TAO that would be ideal.

@jeteve
Copy link
Author

jeteve commented Apr 30, 2025

Ho dear ho dear. I'll look deeper. I saw this patch in our application code, and I wasn't 100% sure, but it smells like the wrong fix for our real problem.

@jeteve
Copy link
Author

jeteve commented Apr 30, 2025

Something is weird though.

If you stay in the context of Request_Interceptor.cpp, it looks like tss->rtscheduler_current_impl_ can only be asigned if.. it's already assigned:

  current = static_cast<TAO_RTScheduler_Current_i *> (tss->rtscheduler_current_impl_);
  // Then under condition:
  if (current != 0)
   {
    .. some logic ..
    // build new_current and..
    tss->rtscheduler_current_impl_ = new_current;
  }

So unless rtscheduler_current_impl_ is bootstrapped somewhere else, it simply cannot be 'not null' just by using the code in this class.

@mitza-oci
Copy link
Member

See the last statement of void Server_Interceptor::receive_request (PortableInterceptor::ServerRequestInfo_ptr ri):

  tss->rtscheduler_previous_current_impl_ = this->current_->implementation (new_current);

The call to TAO_RTScheduler_Current_i* TAO_RTScheduler_Current::implementation (TAO_RTScheduler_Current_i* new_current) stores the value in tss->rtscheduler_current_impl_

@jeteve
Copy link
Author

jeteve commented May 1, 2025

Thanks @mitza-oci ! Do you know if there's a reason why this wouldn't happen in some application code that integrate the ORB?

@mitza-oci
Copy link
Member

Thanks @mitza-oci ! Do you know if there's a reason why this wouldn't happen in some application code that integrate the ORB?

No, I suggest debugging it to see if that function is exiting early or throwing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants