Repository navigation
Feature/per client replies - #49
Merged
Merged
Conversation
With BUILD_SHARED_LIBS=ON on Linux and macOS, the installed tools had no RUNPATH and failed to load libpuppet_master*.so unless LD_LIBRARY_PATH pointed at the install. Installed binaries now carry $ORIGIN/../lib and installed libraries $ORIGIN (@loader_path on macOS), so an install works from any prefix, also after moving it. Only set when PuppetMaster is the top-level project and CMAKE_INSTALL_RPATH is not already defined. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Scheduled servers, asynchronous calls, the system launcher, the topic tool, and recordings. The soname becomes libpuppet_master.so.0.3 and the package accepts only 0.3.x, because TriggerSpec and NodeManifest gained fields. The shm layout, the service wire protocol, and 0.2 JSON configurations are unchanged, so 0.2 and 0.3 processes interoperate. The vehicle pipeline example now asks for PuppetMaster 0.3. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The in-memory and shm transports kept every topic they ever opened in a map of strong references, and FastDDS kept every DDS topic in the participant, until the transport closed. A process that opens many short-lived topics, as a server with per-client reply topics will, grew without bound. Endpoints now own their topic and the transports only find it: in memory the channel is freed, in shm the segment is unmapped and the participant entry released, and in FastDDS the DDS topic is deleted, once no reader or writer in this process uses it. Expired entries are swept when the next endpoint is created. Co-Authored-By: Claude Opus 5.5 <[email protected]>
TopicSpec::lifetime kReaderOwned gives a topic to its one reader, as a service client's reply topic will be. The reader creates it; writers only attach and fail with NotFound when the reader never created it or has closed it. In shared memory the closing reader sets a new retired flag in the segment header (the reserved word, so the layout version is unchanged), wakes attached writers, and removes the segment name. When a reader crashes, the last writer to close, seeing no live process attached, removes the name, so no segment is left behind. FastDDS treats the lifetime as shared: it leaves nothing behind and cannot tell a missing reader from an undiscovered one. shm::Options::topic_prefixes sizes every topic under a name, and a service's deployment settings now also cover `<service>/reply/`. Two shm tests dropped a writer right after creating it and expected the topic to stay; since topics are released with their last endpoint (and on Windows the segment with its last handle), they hold it now. Found by running the test natively on Windows. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every client used to read one shared reply topic and drop the replies meant for others, so with N clients each reply was delivered N times, and a busy client could push other clients' replies out of a shared queue. Each client now reads `<service>/reply/<client id in 16 hex digits>`, a reader-owned topic it creates and removes on Close. The server opens a writer per client on its first reply, through the transport directly (not the runtime, so per-client topics add no metrics series and the server holds what it writes through). On FastDDS it waits for the new writer to match, at most 1 s or until the request's deadline, once per client. A reply that cannot reach its client (closed, or never matched) is dropped and the client times out. The heartbeat thread closes writers idle for ServerOptions::reply_idle_timeout (30 s), which lets shm remove the reply segment of a client that crashed. Wire protocol 2: the header version is 2, and the presence type is service.Presence.v2 v2, so 0.3 and newer processes do not see each other's heartbeats and a mixed call fails with Unavailable instead of timing out. Client::Close now also releases the reply reader. Adds RuntimeContext::FindTransport(TransportKind) and service::ReplyEndpointFor. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
No description provided.