Repository navigation
ABS: poll again on HTTP 502 and 503 instead of failing the request (P4DEVOPS-16690) - #277
Conversation
…4DEVOPS-16690) validate_queue_status_response raised for every status except 200, 202 and 401, so a 502 or 503 from ABS (or the proxy in front of it) failed the whole floaty get on the first answer. run-me-maybe already treats 502 and 503 as 'come back later'. Treat them like a 202: the queue is polled again, bounded by the existing 360 polls. Any other status, including 404, 422 and 500, still raises with the response body.
There was a problem hiding this comment.
🟡 Changes recommended
A 502/503 response with a JSON object body still causes polling to abort with NoMethodError; the response must bypass JSON parsing, with regression coverage for recovery after a JSON 503.
1 open issue
What changed in this PR
This PR updates vmfloaty’s ABS backend to treat HTTP 502 and 503 as transient responses, allowing VM requests to continue through the existing bounded polling loop.
Changes:
- Accepts 502/503 during response validation and provides a verbose retry message.
- Adds specs for status handling and queue responses while preserving errors for other unsuccessful statuses.
| File | Description |
|---|---|
| spec/vmfloaty/abs_spec.rb | Adds validation and queue-response coverage. |
| lib/vmfloaty/abs.rb | Allows 502/503 responses through validation for continued polling. |
Review effort: Balanced
|
@Ramesh7 We may want to go ahead and fix this one as well since we hit a similar issue with vanagon builds:
|
…to the job_id check_queue parsed a JSON body of a 502/503 into a Hash, and retrieve then called strip on it and raised NoMethodError. Return the body as text for 502 and 503 before any parsing. The job_id was user-epoch_ms. Parallel runs under one user can share a millisecond, and ABS now rejects a different request that reuses a job_id (always-be-scheduling#1315), which is not retried. Append 8 random hex digits.
|
Addressed in f36d50c. JSON body on a 502/503 (Copilot). job_id collision (Isaac). The job_id is now Checks. Not verified. Other Ruby versions (CI matrix passed), and a live ABS. The |

Status
Ready for review
Description
ABS.validate_queue_status_responseraised for every status except 200, 202 and 401, so one 502 or 503 from ABS (or the proxy in front of it) failed the wholefloaty get. run-me-maybe already treats 502 and 503 as "come back later". See P4DEVOPS-16690.HTTP <code>: <request> request to ABS failed!with the response body.floatyoptions or to the output on success.Testing
bundle exec rspec: 147 examples, 0 failures (Ruby 3.1.4). New specs inspec/vmfloaty/abs_spec.rb:validate_queue_status_responsefor 200/202, 502/503 (no raise, message when verbose), 404 with body, 422 and 500, 401;check_queuereturns the body for a 503 and the hosts for a 200. Three of the new specs fail without the change.Not checked:
retrieverun against ABS. The polling loop sleeps, so I coveredcheck_queueand the validation only.main. This change adds Metrics warnings forvalidate_queue_status_response(complexity and length), and I did not clean them up.Related Issues
floaty getprints no JSONTodos