Skip to content

PowerFlex/ScaleIO client initialization, authentication and command execution improvements#12391

Open
sureshanaparti wants to merge 3 commits intoapache:4.22from
shapeblue:powerflex_scaleio-client-and-cmd-exec-improvements
Open

PowerFlex/ScaleIO client initialization, authentication and command execution improvements#12391
sureshanaparti wants to merge 3 commits intoapache:4.22from
shapeblue:powerflex_scaleio-client-and-cmd-exec-improvements

Conversation

@sureshanaparti
Copy link
Contributor

Description

This PR improves PowerFlex/ScaleIO client initialization , authentication and command execution.

  • Handles busy-wait for ScaleIO client authentication, and client creation potential deadlock
  • Adds default timeout 5 minutes for PowerFlex commands (dfv_cfg, etc.) execution (instead of default 60 min.) to fit into asynchronous command (Management Server -> Agent) timeout.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

❌ Patch coverage is 29.88506% with 61 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.62%. Comparing base (425c4e3) to head (ff1abb9).
⚠️ Report is 136 commits behind head on 4.22.

Files with missing lines Patch % Lines
...ore/client/ScaleIOGatewayClientConnectionPool.java 10.52% 34 Missing ⚠️
...orage/datastore/manager/ScaleIOSDCManagerImpl.java 0.00% 16 Missing ⚠️
...age/datastore/client/ScaleIOGatewayClientImpl.java 44.44% 3 Missing and 2 partials ⚠️
...atastore/driver/ScaleIOPrimaryDataStoreDriver.java 20.00% 4 Missing ⚠️
...torage/motion/StorageSystemDataMotionStrategy.java 0.00% 0 Missing and 1 partial ⚠️
.../apache/cloudstack/framework/config/ConfigKey.java 83.33% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.22   #12391      +/-   ##
============================================
+ Coverage     17.59%   17.62%   +0.02%     
- Complexity    15598    15669      +71     
============================================
  Files          5910     5917       +7     
  Lines        529692   531272    +1580     
  Branches      64716    64947     +231     
============================================
+ Hits          93202    93638     +436     
- Misses       425998   427097    +1099     
- Partials      10492    10537      +45     
Flag Coverage Δ
uitests 3.70% <ø> (+0.12%) ⬆️
unittests 18.69% <29.88%> (+0.03%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances PowerFlex/ScaleIO client initialization, authentication, and command execution by implementing lazy authentication, improving busy-wait handling, and adding default command timeouts. The changes address potential deadlock scenarios and ensure commands complete within asynchronous timeout limits.

Key Changes:

  • Deferred client authentication from constructor to first API call with proper session expiry detection
  • Added 5-minute default timeout for PowerFlex command execution to fit within async command timeouts
  • Improved connection pool synchronization to prevent concurrent client initialization

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
ScaleIOGatewayClientImpl.java Removed eager authentication from constructor, added volatile flag and busy-wait with Thread.yield(), enhanced session expiry checks
ScaleIOGatewayClientConnectionPool.java Improved synchronization with explicit lock object, refactored client creation with Optional, added debug logging
ScaleIOUtil.java Added DEFAULT_TIMEOUT_MS constant, updated all command executions to use timeout, added --file parameter to query commands, simplified removeMdms error handling
ScaleIOSDCManagerImpl.java Fixed canUnprepareSDC logic to return false when multiple pools share same SDC, improved isHostSdcConnected loop structure and logging
ScaleIOPrimaryDataStoreDriver.java Removed throws Exception declarations from method signatures
ScaleIOGatewayClientImplTest.java Moved authentication verifications after API calls to align with lazy authentication
ScaleIOStoragePoolTest.java Updated mocks to include timeout parameter in Script.runSimpleBashScript calls
ScaleIOStorageAdaptorTest.java Updated mocks to include timeout parameter and --file parameter in commands
ConfigKey.java Added valueInDomain convenience method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16303

@borisstoyanov borisstoyanov marked this pull request as ready for review January 19, 2026 11:23
@borisstoyanov
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@borisstoyanov a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-15207)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 53999 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr12391-t15207-kvm-ol8.zip
Smoke tests completed. 148 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_03_deploy_and_scale_kubernetes_cluster Failure 28.89 test_kubernetes_clusters.py

@vladimirpetrov vladimirpetrov self-assigned this Jan 28, 2026
@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✖️ debian ✔️ suse15. SL-JID 16806

@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el8 ✖️ el9 ✔️ debian ✖️ suse15. SL-JID 16809

@vladimirpetrov
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@vladimirpetrov a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el8 ✖️ el9 ✔️ debian ✖️ suse15. SL-JID 16811

@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16814

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

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

5 participants