Skip to content

Add debug logging to handle manager#876

Open
bukka wants to merge 1 commit into
softhsm:mainfrom
bukka:handle-manager-debug-msgs
Open

Add debug logging to handle manager#876
bukka wants to merge 1 commit into
softhsm:mainfrom
bukka:handle-manager-debug-msgs

Conversation

@bukka
Copy link
Copy Markdown
Member

@bukka bukka commented May 17, 2026

This is to better track object handling.

Summary by CodeRabbit

  • Chores
    • Added additional debug logging around session and object lifecycle events (registrations, destructions, session close/logout flows). No behavioral changes or user-visible impact.

Review Change Stack

@bukka bukka requested a review from a team as a code owner May 17, 2026 17:27
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2a153e95-7dc3-4da9-a1be-c1bf35f44eb8

📥 Commits

Reviewing files that changed from the base of the PR and between 8ea0a2f and e168155.

📒 Files selected for processing (1)
  • src/lib/handle_mgr/HandleManager.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/lib/handle_mgr/HandleManager.cpp

📝 Walkthrough

Walkthrough

Adds DEBUG_MSG logging across HandleManager.cpp: on session/token object registration, object destruction (including missing-handle cases), session closure (early-return and success), batch session closure, and token logout, with per-object erasure logs.

Changes

Handle Manager Debug Instrumentation

Layer / File(s) Summary
Handle Registration Logging
src/lib/handle_mgr/HandleManager.cpp
addSessionObject and addTokenObject emit DEBUG_MSG after registering handles, recording handle ID, slot/session context, and object pointer address.
Handle Lifecycle and Closure Logging
src/lib/handle_mgr/HandleManager.cpp
destroyObject logs destruction and missing-handle cases; sessionClosed logs session-not-found and successful closure and per-object erasures; allSessionsClosed logs batch closure start and per-token-object erasures for empty slots; tokenLoggedOut logs each private object handle erased.

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A rabbit peeks at traces in the code,
Nibbling bits where handles go and grow,
Logs whisper where the sessions close,
Objects vanish, the debugger knows,
Hopping off with a tidy glow 🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add debug logging to handle manager' accurately and concisely summarizes the main change in the pull request, which adds DEBUG_MSG logs to HandleManager.cpp.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib/handle_mgr/HandleManager.cpp`:
- Around line 176-179: In HandleManager.cpp, update the diagnostic messages
emitted by DEBUG_MSG when handling hObject: change the first message to fix the
typo ("Destroyed object handle: %lu") and change the else-case to accurately
state the handle isn't an object (e.g., "Handle %lu exists but is not an object"
or "Handle %lu refers to a non-object"). Locate the DEBUG_MSG calls around the
destroy logic that reference hObject and replace the two strings accordingly so
they are precise and correctly spelled.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 93c3957f-2560-4623-b943-f673f069d713

📥 Commits

Reviewing files that changed from the base of the PR and between 02cebd5 and 8ea0a2f.

📒 Files selected for processing (1)
  • src/lib/handle_mgr/HandleManager.cpp

Comment thread src/lib/handle_mgr/HandleManager.cpp Outdated
This is to better track object handling
@bukka bukka force-pushed the handle-manager-debug-msgs branch from 8ea0a2f to e168155 Compare May 17, 2026 21:17
@antoinelochet
Copy link
Copy Markdown
Contributor

Love to see this

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