nagaboinaramgopal opened a new pull request, #14090:
URL: https://github.com/apache/cloudstack/pull/14090

   ### Description
   
   The out-of-band management power-state poll task submits a per-host power 
status task to a background executor. That task, PowerOperationTask, was a 
plain Runnable, while the poll task that submits it is a 
ManagedContextRunnable. Running the per-host work outside a managed context 
means the database connection its DB work acquires on the worker thread is 
never released back to the pool. Over time this leaks one connection per 
configured host on every run, and once the pool reaches maxActive the 
management server stops serving requests with "Connection is not available, 
request timed out".
   
   This makes PowerOperationTask a ManagedContextRunnable, matching the poll 
task that submits it, so the managed context releases the connection when each 
run finishes.
   
   Fixes: #13382
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [x] 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
   - [x] Major
   - [ ] Minor
   - [ ] Trivial
   
   ### Screenshots (if appropriate):
   
   N/A
   
   ### How Has This Been Tested?
   
   Added a unit test that runs the task and checks it is a 
ManagedContextRunnable and that running it still performs the power operation, 
so the per-host work now runs inside a managed context and the delegation is 
unchanged.
   
   #### How did you try to break this feature and the system with this change?
   
   The change only wraps the existing per-host work in a managed context and 
does not change what it does. The sibling poll task that submits this task 
already uses the same managed-context base, so the two now behave consistently.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to