Closed rafaelgomesxyz closed 3 months ago
The changes address an issue where the ps:wait
command would hang indefinitely if a workload was suspended. A new method workload_suspended?
was introduced to check for suspended workloads, and the call
method in the PsWait
class was updated to skip suspended workloads. Additionally, new test cases were added to ensure the new functionality works correctly.
File | Change Summary |
---|---|
lib/command/ps_wait.rb |
Updated call method to include a check for suspended workloads before waiting for readiness. |
lib/core/controlplane.rb |
Added workload_suspended? method to check if a workload is suspended. |
spec/command/ps_wait_spec.rb |
Added test cases for scenarios with and without suspended workloads. |
CHANGELOG.md |
Documented the fix for the issue where ps:wait hangs indefinitely with suspended workloads. |
sequenceDiagram
participant User
participant PsWait
participant ControlPlane
User->>PsWait: call
PsWait->>ControlPlane: workload_suspended?(workload)
ControlPlane-->>PsWait: true/false
alt workload is suspended
PsWait->>User: Skip workload (log "suspended")
else workload is not suspended
PsWait->>User: Wait for workload readiness
end
Objective | Addressed | Explanation |
---|---|---|
Fix endless loop when pg:wait suspended workload (#197) |
✅ | |
Skip suspended workload and potentially log "suspended" (#197) | ✅ |
In the code where bugs once lay, A rabbit hopped and saved the day. No more loops that never end, Workloads now suspend, my friend. With tests and checks, it’s all set right, CodeRabbit’s touch, a coder’s delight. 🌟🐇
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Fixes #197
The
ps:wait
command hangs forever if workloads are suspended. This PR fixes that by printing a message when a workload is suspended and skipping it.Summary by CodeRabbit
New Features
Bug Fixes
ps:wait
command would hang indefinitely if workloads were suspended.Tests
Documentation