Skip to content

Conversation

@nfebe
Copy link
Contributor

@nfebe nfebe commented Dec 22, 2025

BusyBox wget ignores --timeout flag causing security health endpoint to hang indefinitely. Switch to curl first with reliable timeouts.

BusyBox wget ignores --timeout flag causing security health endpoint
to hang indefinitely. Switch to curl first with reliable timeouts.

Signed-off-by: nfebe <fenn25.fn@gmail.com>
@sourceant
Copy link

sourceant bot commented Dec 22, 2025

Code Review Summary

This review covers changes to the checkNginxCanReachAgent function in internal/infra/manager.go. The primary goal of the modification was to enhance the robustness of network reachability checks by reordering the network utility attempts (prioritizing curl) and adding a max-time option to the curl command. However, the change also inadvertently removed crucial documentation.

🚀 Key Improvements

  • The curl command now includes a --max-time option, which provides a more comprehensive timeout mechanism, preventing the command from hanging indefinitely on slow responses.
  • The reordering to prioritize curl is a sensible change, as curl is generally a more feature-rich and widely available utility in modern container images compared to wget.

💡 Minor Suggestions

  • While effective, the multi-line fmt.Sprintf for constructing shell commands can be verbose. For more complex scenarios, consider encapsulating shell command execution logic into a reusable helper to improve readability and consistency, though this is a minor point for the current implementation.

🚨 Critical Issues

  • The doc comment for the checkNginxCanReachAgent function, along with explanatory inline comments, was removed. This significantly degrades the code's readability and maintainability and must be restored to ensure clarity for future development.

Copy link

@sourceant sourceant bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review complete. No specific code suggestions were generated. See the overview comment for a summary.

@nfebe nfebe merged commit 08fb25d into main Dec 22, 2025
5 checks passed
@nfebe nfebe deleted the fix/security-health-timeout branch December 22, 2025 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants