Fix connection leak in gst-client interactive mode#340
Open
clogwog wants to merge 2 commits intoRidgeRun:developfrom
Open
Fix connection leak in gst-client interactive mode#340clogwog wants to merge 2 commits intoRidgeRun:developfrom
clogwog wants to merge 2 commits intoRidgeRun:developfrom
Conversation
In gstd_client_cmd_socket the GSocketConnection allocated by g_socket_client_connect_to_host was only closed and unrefed on the read/write error paths. The success path fell through to 'out:' without closing, leaking one fd and one GObject per command. On the gstd side this is more impactful than a typical client leak: the threaded socket service holds a worker thread per open connection (g_threaded_socket_service_new in gstd_tcp.c). After N successful commands from an interactive gst-client session against gstd started with --tcp-max-threads N, all worker slots are pinned on idle leaked connections and subsequent connections queue indefinitely. Fold the close+unref into the unified 'out:' label so success and error paths share a single cleanup, and guard with a NULL check so the early-return path where g_socket_client_connect_to_host returns NULL stays safe.
Author
|
i thought i checked out my own fork and made the changes in there, but somehow my PR immediately showed up in the RidgeRun repo.. I may have done something wrong. if so, please feel free to delete the PR and i'll try again |
Author
|
tested the same test in #339 and it no longer hangs after a single request |
Author
|
mmm maybe the connection isn't closed so things like eos notifications still arrive ? |
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.
see description #339