Skip to content

fix: show idle MySQL sessions with textual processlist boolean - #6031

Merged
renecannao merged 6 commits into
v3.0from
agent/fix-processlist-idle-boolean
Aug 11, 2026
Merged

fix: show idle MySQL sessions with textual processlist boolean#6031
renecannao merged 6 commits into
v3.0from
agent/fix-processlist-idle-boolean

Conversation

@renecannao

@renecannao renecannao commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Parse textual true/false values correctly when synchronizing mysql-session_idle_show_processlist into the admin processlist configuration.
  • Add a TAP regression test covering hidden idle sessions with false and visible idle sessions with textual true.
  • Register the regression test in the standard MySQL g1 groups.

Root cause

The MySQL processlist callback used atoi(varvalue). Although the MySQL variable accepted the textual value true, atoi("true") evaluates to zero. The separate admin-side processlist configuration therefore continued hiding sessions moved to idle maintenance threads.

Validation

Passing:

  • make -j4 build_tap_test_debug (exit 0; includes the documented dependency, library, ProxySQL, and TAP build chain)
  • Official isolated TAP runner: reg_test_processlist_idle_boolean-t passed 2/2 assertions
    • false: idle session hidden, count 0
    • textual true: idle session visible, count 1
  • python3 test/tap/groups/lint_groups_json.py
  • python3 test/tap/groups/check_groups.py --source
  • git diff --check origin/v3.0...HEAD

The earlier direct component make invocations omitted the repository's dependency bootstrap chain and were not valid clean-checkout validation; the resulting "missing mysql.h/curl" note was incorrect.

Summary by CodeRabbit

  • Bug Fixes

    • Fixed MySQL idle-session visibility settings to correctly recognize true/false and 1/0 values.
    • Idle sessions now appear or remain hidden in the process list according to the configured setting.
  • Tests

    • Added regression coverage for enabling and disabling idle-session visibility across supported MySQL environments.
  • Documentation

    • Added design and implementation documentation for the process-list visibility fix.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The change updates MySQL idle-session processlist boolean parsing and adds TAP coverage for disabled and enabled visibility. The test is registered across supported MySQL-related groups. PostgreSQL handling remains unchanged.

Changes

MySQL idle processlist visibility

Layer / File(s) Summary
Boolean synchronization behavior
lib/Admin_FlushVariables.cpp, docs/superpowers/specs/..., docs/superpowers/plans/...
The MySQL callback treats case-insensitive true and 1 as enabled values instead of using numeric-only parsing.
Visibility regression coverage
test/tap/tests/reg_test_processlist_idle_boolean-t.cpp, test/tap/groups/groups.json, docs/superpowers/plans/...
The TAP test checks idle-session visibility for false and true settings, restores defaults, and runs in standard MySQL-related groups.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • sysown/proxysql#5166: Modifies the same MySQL admin-variable synchronization path and adds related boolean configuration tests.
  • sysown/proxysql#6017: Changes runtime variable-flush handling in the same function for a different setting.

Sequence Diagram(s)

sequenceDiagram
  participant TAPTest
  participant ProxySQLAdmin
  participant ProxySQLFrontend
  participant Processlist
  TAPTest->>ProxySQLAdmin: Set idle-session visibility to false
  TAPTest->>ProxySQLFrontend: Create an idle session
  TAPTest->>Processlist: Verify the session is hidden
  TAPTest->>ProxySQLAdmin: Set idle-session visibility to true
  TAPTest->>Processlist: Verify the session is shown
  TAPTest->>ProxySQLAdmin: Restore defaults
Loading

Poem

A rabbit found a boolean bright,
“true” now makes the sessions light.
“false” keeps idle rows away,
TAP checks both without delay.
The processlist hops right today!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: show idle MySQL sessions with textual processlist boolean' directly describes the main change: fixing textual boolean handling for the mysql-session_idle_show_processlist variable to display idle sessions correctly.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/fix-processlist-idle-boolean

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.

@gitar-bot

gitar-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Fixes MySQL processlist idle boolean synchronization by correctly parsing textual true/false values instead of relying on atoi, and adds a TAP regression test. No issues found.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud

Copy link
Copy Markdown

@renecannao
renecannao marked this pull request as ready for review August 11, 2026 06:05

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 07d5fd2cc3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

return EXIT_FAILURE;
}

if (!processlist_count(admin, session_id, &count)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Poll until the enabled processlist sees the idle session

Under scheduler contention, the preceding wait for a zero count can finish while the session is still being transferred through idle_mysql_sessions or myexchange.idle_mysql_sessions, before idle_thread_gets_sessions_from_worker_thread() registers it with an idle thread; those transfer queues are not enumerated by SQL3_Processlist(). The single query here can consequently still return zero after the flag is correctly enabled, making this newly registered CI test flaky. Use wait_for_processlist_count(..., 1, ...) for the enabled state as well.

Useful? React with 👍 / 👎.

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.66337% with 67 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.37%. Comparing base (6a6913b) to head (07d5fd2).
⚠️ Report is 25 commits behind head on v3.0.

Files with missing lines Patch % Lines
.../tap/tests/reg_test_processlist_idle_boolean-t.cpp 33.33% 43 Missing and 23 partials ⚠️
lib/Admin_FlushVariables.cpp 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             v3.0    #6031      +/-   ##
==========================================
- Coverage   53.40%   53.37%   -0.04%     
==========================================
  Files         487      488       +1     
  Lines      145258   145358     +100     
  Branches    36704    36729      +25     
==========================================
+ Hits        77579    77582       +3     
- Misses      50732    50747      +15     
- Partials    16947    17029      +82     
Flag Coverage Δ
integration-tests 49.32% <33.66%> (-0.04%) ⬇️
unit-tests 15.69% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@renecannao
renecannao merged commit efa624d into v3.0 Aug 11, 2026
81 of 83 checks passed
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.

1 participant