Conversation
|
/run-security-scan |
alexcos20
left a comment
There was a problem hiding this comment.
AI automated code review (Gemini 3).
Overall risk: low
Summary:
This PR introduces a configurable download timeout for pulling Docker images in C2D jobs using AbortSignal.timeout(), effectively mitigating issues where jobs could hang indefinitely. It also introduces a minor cleanup in the status handler to exclude properties when C2D features are unavailable. The implementation is concise and well-designed.
Comments:
• [INFO][edge_case] Node's internal setTimeout (used by AbortSignal.timeout) accepts a maximum 32-bit signed integer value (2147483647 ms). If an operator misconfigures C2D_DOWNLOAD_TIMEOUT to a value greater than 2147483 seconds, the timeout will overflow and default to 1ms, resulting in immediate job failures. Consider clamping the maximum allowed value to prevent this edge case:
- return parsed * 1000
+ return Math.min(parsed * 1000, 2147483647)• [INFO][style] Great use of AbortSignal.timeout() here. It handles request/streaming timeouts at the core library level without the overhead of manual tracking and Promise.race() patterns. LGTM!
Fixes #1251 .
Changes proposed in this PR: