fix(scan): surface tier1 finalize failures with a retry (REA-454)#1330
Closed
Benjamin Barslev Nielsen (barslev) wants to merge 2 commits into
Closed
Conversation
handleCreateNewScan was calling finalizeTier1Scan and discarding the CResult. When the finalize POST failed (transient 5xx, network blip, etc.) the CLI logged nothing and exited 0, while depscan's tier1 reachability scan row stayed in INIT forever. Investigation found >60k stuck INIT-with-metadata rows in coreweave that had a socket_cli_version set, confirming socket-cli was the lost finalizer. Capture the result, retry once on any failure, and surface a clear error including the scan id and tier1 reachability scan id if both attempts fail. Exit code is intentionally unchanged: the full scan upload above already succeeded, and finalize is metadata-only.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit e90c2c9. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
handleCreateNewScanwas callingfinalizeTier1Scanand discarding theCResult. When the finalize POST failed (transient 5xx, network blip, etc.) the CLI logged nothing and exited 0, while tier1 reachability scan row stayed inINITforever.This change captures the result, retries once on any failure, and surfaces a clear
logger.error(including the scan id and tier1 reachability scan id) if both attempts fail. The user-facing exit code is intentionally unchanged: the full scan upload already succeeded, and finalize is metadata-only.