[RSDK-9869] Globally Manage Lifecycle of Shared Connection to App #4761
+8
−10
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.
After unifying the connections to App used by RDK's net appender and restart checker, we realized that the lifecycle of the connection they now share should not be managed by either of them. The net appender already does not manage it (i.e., it never tries to close it), but the restart checker does try to close the connection. This PR stops the restart checker from closing it and instead closes the connection when the server exits - once we know it [the connection] isn't getting used anymore. This oversight became apparent through the logs below. The net appender was incorrectly logging messages in its queue because the restart checker was closing the connection required for the logging to succeed.
2025-01-30T15:03:54.717Z INFO rdk.networking.netlogger logging/net_appender.go:303 error logging to network: not connected 2025-01-30T15:03:56.356Z WARN rdk.networking.netlogger logging/net_appender.go:181 NetAppender.Close() did not progress in 1.5s, closing with 22 still in queue