Added missing Debug Level testing for "Send Reply Current is 0"
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
.devcontainerdirectory or file in version control.
- Updated settings to ignore the
-
Bug Fixes
- Adjusted debug message logging so that certain messages are shown only when debugging is enabled, reducing unnecessary log output.
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,
.devcontainernow 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 e3b027b753b21daf35682d34a1f0f1f4c7af40ff and 46252a0681d503b00eca554e2de384c4659c0def.
📒 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 .gitignoreAdding
.devcontainerto 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 checkThis 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.
🪧 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
@coderabbitaiin 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
@coderabbitaiin 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 pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai full reviewto do a full review from scratch and review all the files again. -
@coderabbitai summaryto regenerate the summary of the PR. -
@coderabbitai generate docstringsto generate docstrings for this PR. -
@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR. -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai configurationto show the current CodeRabbit configuration for the repository. -
@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile 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.
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.
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.
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.
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.
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.
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_
Thanks @mitza-oci ! Do you know if there's a reason why this wouldn't happen in some application code that integrate the ORB?
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.