feat: proper backoff and port number #195
Merged
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.
This pull request improves the configuration handling and process monitoring of several backend components in the agent. The main changes include making port configuration more robust by accepting any value type, enhancing process readiness checks to handle unexpected process exits, and improving logging for debugging purposes.
Configuration improvements:
Configuremethods in multiple backends (deviceDiscoveryBackend,networkDiscoveryBackend,openTelemetryBackend,snmpDiscoveryBackend,workerBackend,pktvisorBackend) to accept theportconfiguration as any value type, converting it to a string usingfmt.Sprintf. This makes the configuration more flexible and prevents type assertion errors if the port is not provided as a string. [1] [2] [3] [4] [5] [6]Process monitoring and error handling:
Startmethods in several backends (deviceDiscoveryBackend,networkDiscoveryBackend,openTelemetryBackend) to check if the managed process has exited unexpectedly during readiness checks. If so, the process is stopped, an error is logged, and a descriptive error is returned. This improves reliability and error reporting. [1] [2] [3]Logging and debugging:
pktvisorBackendreadiness check to log process status and the URL being checked, aiding in debugging startup issues.Startup timing adjustment:
networkDiscoveryBackend'sStartmethod from 1 second to 4 seconds to allow more time for the process to start up before checking its status.