Repository navigation
Conversation
CameraReader::open on a default endpoint no longer fails when no plugin answers: it starts camera_plugin (the one next to the program, on PATH, or named in PluginLocation), waits for it, and reads. The plugin is started detached, so it outlives the reader, serves any other reader that comes along, and leaves nothing for the host program to reap. A plugin started this way is passed --exit-when-idle, which makes it exit once no reader has been connected for that long, so it does not outstay its use. When several readers start a plugin at the same moment, one plugin gets the endpoint and serves them all; the others find it taken and leave. A plugin that starts but cannot serve is reported instead of waited for. The plugin's manifest is now copied next to its executable, which makes the build tree a directory the plugin manager can start the plugin from. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Farbod Motlagh <fmotlagh@nvidia.com>
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
6 tasks done
This branch was successfully deployed
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.
Description
Eleventh pull request of the camera interface, stacked on #1532 (default endpoint and configuration file), whose branch is this one's base.
After #1532 a reader finds a running plugin without being told where it is. With this one it also works when no plugin is running: the reader starts it.
camera_plugin: the one next to the program, or onPATH, or the one named inPluginLocation::executable. It then waits until the plugin serves. A plugin behind an explicit socket path is never started, andstart_if_absent = falseturns this off.forkandexec, makes system calls only, because the host may have threads holding locks at that moment.--exit-when-idle=SECONDS(30 by default), a new plugin argument: the plugin exits once no reader has been connected for that long. A plugin started by hand, by a service or by the plugin manager is not given it and runs until it is told to stop.Type of change
Testing
Three new cases in
tests/cpp/plugins/camera/test_camera_plugin.cpp, all with real processes and their own runtime and configuration directories:All 80 camera tests pass through CTest, and under AddressSanitizer with UBSan; the reader and plugin suites ran three times each under ThreadSanitizer with no reports. 12 repeated runs of the plugin suite without a failure, and no plugin process left behind.
Built through the repository's own build (
BUILD_PLUGINS=ON) with the project warning set promoted to errors. Ubuntu 22.04 x86_64, GCC 11.4, Linux 6.8.clang-format-14reports no changes;SKIP=check-copyright-year pre-commit run --all-filespasses.Checklist
SKIP=check-copyright-year pre-commit run --all-filesgit commit -s) per the DCO🤖 Generated with Claude Code