Repository navigation
XSUP-80841 | fix(qualys): fail fast on Qualys 1960 in test and get-assets - #46573
DanielTal87 wants to merge 1 commit into
Conversation
🤖 AI-Powered Code Review AvailableYou can leverage AI-powered code review to assist with this PR! Available Commands:
|
|
🤖 Analysis started. Please wait for results... |
🤖 AI Review DisclaimerThis review was generated by an AI-powered tool and may contain inaccuracies. Please be advised, and we extend our sincere apologies for any inconvenience this may cause. |
marketplace-ai-reviewer
left a comment
There was a problem hiding this comment.
Hi there, thanks for your contribution!
Overall the changes look good, with just a minor suggestion to improve our debug logging by including the exception traceback when hitting concurrency limits.
Once that's addressed, we should be good to go!
@dtroushinsky, @JasBeilin, @DanielTal87 please review and approve the results generated by the AI Reviewer by responding 👍 on this comment.
| except DemistoException as e: | ||
| if not Client._is_concurrency_limit_error(getattr(e, "res", None)): | ||
| raise | ||
| demisto.debug("[HTTP Error] Host list request hit the concurrency limit; failing fast for the interactive call.") |
There was a problem hiding this comment.
Consider including the exception traceback in the debug log via traceback.format_exc():
| demisto.debug("[HTTP Error] Host list request hit the concurrency limit; failing fast for the interactive call.") | |
| demisto.debug( | |
| f"[HTTP Error] Host list request hit the concurrency limit; failing fast for the interactive call.\n{traceback.format_exc()}" | |
| ) |
|
Validate summary Verdict: PR can be force merged from validate perspective? ✅ |
🔍 AI Triage Report AvailableAn automated triage report has been generated for this pipeline. Status: 📋 Triage Report
|
Status
Related Issues
fixes: https://jira-dc.paloaltonetworks.com/browse/XSUP-80841
related: https://jira-dc.paloaltonetworks.com/browse/XSUP-76520
Description
Problem
Qualys allows a limited number of simultaneous calls to the host list detection API per account (2 for the reporting account:
x-concurrency-limit-limit: 2). When both slots are busy, Qualys answers409with Error Code1960("This API cannot be run again until 1 currently running instance has finished").Since 3.4.10 (XSUP-76520),
_request_with_concurrency_retrybacks off 60s and retries twice on 1960. That retry was meant for fetch-assets, but every caller ofget_host_list_detectioninherits it, including test-module and qualys-get-assets. Any 1960 makes them run ≥ 120s and fail, which is past the 60s instance test timeout (request timed out after 1m0s).Findings
qualys-get-assetsdebug log shows 3 detection requests 60s apart, all 409/1960 withx-concurrency-limit-running: 2, failing after 124.5s.nextTrigger, total assets 68,981 → 146,529 in ~35 min) and held one slot for minutes per run. The other was held by an earlier instance test that kept running in the background up to the 5-minute script limit after the UI gave up at 60s.Fix
get_host_list_detectiongetsretry_on_concurrency_limit(defaultTrue), and_request_with_concurrency_retrygetsmax_retries.get_host_list_detections_events(used only by test-module and qualys-get-assets) passesFalse. On 1960 it fails immediately with a clear message ("Qualys concurrency limit reached (Error Code 1960) … usually because the assets and vulnerabilities fetch is running. Try again after it finishes."), keeping the original Qualys error.request_host_list_page) andget_vulnerabilitieskeep the existing 60s × 2 back-off. Fetch behavior andlast_runare unchanged.x-concurrency-limit-running/limitheaders on each 1960.demisto/python3:3.12.15.14069087. Version 3.5.1 → 3.5.2.Tests
test_interactive_host_list_fails_fast_on_concurrency_limit(test-module, qualys-get-assets): 1 request, no sleep, clear message. It failed before the fix withassert 3 == 1.test_host_list_skips_concurrency_retry_when_disabled,test_host_list_without_retry_returns_first_success.test_interactive_host_list_keeps_other_errors_unchanged(401, 500, 409/1965): other errors pass through unchanged.Must have