Skip to content

Improve PowerShell execution and failure backoff for Windows disk metrics collection#17747

Merged
jt2594838 merged 1 commit into
masterfrom
cp-sia
May 27, 2026
Merged

Improve PowerShell execution and failure backoff for Windows disk metrics collection#17747
jt2594838 merged 1 commit into
masterfrom
cp-sia

Conversation

@Caideyipi
Copy link
Copy Markdown
Collaborator

Description

  • Improve the stability of Windows disk metrics collection when invoking PowerShell.
  • Prefer the powershell.exe under SystemRoot / windir to reduce PATH dependency.
  • Add a 5-minute retry backoff on failures and throttle repeated failure logs.
  • Introduce a PowerShell executor abstraction and add unit tests for both the success path and failure backoff case.

This PR has:

  • been self-reviewed.
    • concurrent read
    • concurrent write
    • concurrent read and write
  • added documentation for new or modified features or behaviors.
  • added Javadocs for most classes and all non-trivial methods.
  • added or updated version, license, or notice information
  • added comments explaining the "why" and the intent of the code wherever would not be obvious
    for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold
    for code coverage.
  • added integration tests.
  • been tested in a test IoTDB cluster.

Key changed/added classes (or packages if there are too many classes) in this PR

@sonarqubecloud
Copy link
Copy Markdown

@jt2594838 jt2594838 merged commit 0cc7e9d into master May 27, 2026
42 of 43 checks passed
@jt2594838 jt2594838 deleted the cp-sia branch May 27, 2026 07:52
luoluoyuyu

This comment was marked as outdated.

Copy link
Copy Markdown
Member

@luoluoyuyu luoluoyuyu left a comment

Choose a reason for hiding this comment

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

Review summary

Improves Windows disk metrics collection: resolves powershell.exe under System32, backs off for 5 minutes after failures, rate-limits failure logs, and injects PowerShellExecutor for testing.

Looks good to merge.

List<String> result = new ArrayList<>();
List<String> rawOutput = new ArrayList<>();
Process process = null;
if (System.currentTimeMillis() < nextPowerShellRetryTime) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

During backoff, returning an empty list means disk metrics are temporarily absent rather than stale. Acceptable to stop log storms; optional improvement is to log next retry time at WARN when entering backoff.

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.

4 participants