Bound NGINX Plus API requests with a timeout#1775
Open
CVanF5 wants to merge 1 commit into
Open
Conversation
The NGINX Plus API HTTP client had no timeout, so a Plus API call that never responds (e.g. an unresponsive Plus API socket) blocks the agent's single-threaded message bus indefinitely. The agent then never sends a DataPlaneResponse, leaving the management plane waiting on it. - Set the HTTP client timeout from Client.HTTP.Timeout (falling back to a default when unset), following the existing datasource/config pattern. - Bound the unix socket dial with net.Dialer.Timeout and pass the per-request context through, following internal/grpc/proxy_dialer.go, so a stuck socket cannot block the dial. - Return the original error from createPlusAPIError when it cannot be parsed into the structured Plus API format (e.g. a timeout). Previously it returned nil, so a failed apply was reported to the management plane as COMMAND_STATUS_OK instead of a failure.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1775 +/- ##
==========================================
+ Coverage 84.89% 84.92% +0.02%
==========================================
Files 105 105
Lines 13656 13663 +7
==========================================
+ Hits 11593 11603 +10
+ Misses 1540 1538 -2
+ Partials 523 522 -1
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
karensantana
approved these changes
Jul 1, 2026
dhurley
approved these changes
Jul 1, 2026
Akshay2191
approved these changes
Jul 1, 2026
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.
The NGINX Plus API HTTP client had no timeout, so a Plus API call that never responds (e.g. an unresponsive Plus API socket) blocks the agent's message bus indefinitely. The agent then never sends a
DataPlaneResponse, leaving the management plane waiting on it.Client.HTTP.Timeout(falling back to a default when unset), following the existing datasource/config pattern.net.Dialer.Timeoutand pass the per-request context through, following internal/grpc/proxy_dialer.go, so a stuck socket cannot block the dial.COMMAND_STATUS_OKinstead of a failure.Checklist
Before creating a PR, run through this checklist and mark each as complete.
CONTRIBUTINGdocumentmake install-toolsand have attached any dependency changes to this pull requestREADME.md)