Skip to content

api: public service discovery experimental API - #391

Merged
MariusBgm merged 13 commits into
mainfrom
dev_public_service_discovery_capi
Oct 23, 2026
Merged

MariusBgm merged 13 commits into
mainfrom
dev_public_service_discovery_capi

Conversation

@MariusBgm

@MariusBgm MariusBgm commented Jul 15, 2026 •

Copy link
Copy Markdown
Collaborator

This service discovery API design aims to hide internals (Pub/Sub matching, Client/Server matching, Supplemental Infos / internal encodings) from the public.
Changes:

  • Service Created/Removed events
  • service discriptor carries much more information than the internal discovery provides (we do the housekeeping on behalf of the user / to hide internals)
  • pub-sub and rpc client-server matching is announced as a Link event, similar to NetworkSimulator links

already added an hourglass on top (to see if the C design is sound)
Rebased and fixed memory saftey issues -> improvements will be in the PR stack on top

@MariusBgm MariusBgm added the status: design proposal New design or API. Needs a design review and an agreement on the direction. label Jul 15, 2026
@MariusBgm MariusBgm changed the title api: public service discovery CAPI PoC api: public service discovery PoC Jul 21, 2026
@KonradBreitsprecherBkd
KonradBreitsprecherBkd added this pull request to stack #435 October 5, 2026 13:44
@MariusBgm
MariusBgm force-pushed the dev_public_service_discovery_capi branch 4 times, most recently from 2cb9cc1 to a5c423b Compare October 6, 2026 14:32
@MariusBgm
MariusBgm marked this pull request as ready for review October 7, 2026 10:28
MariusBgm and others added 12 commits October 13, 2026 16:35
Signed-off-by: Marius Börschig <Marius.Boerschig@vector.com>
Signed-off-by: Marius Börschig <Marius.Boerschig@vector.com>
drop UUID and other internals. only provide primaryIdentifier as handle key

Signed-off-by: Marius Börschig <Marius.Boerschig@vector.com>
add validator integration testcase for matchin pub + sub

Signed-off-by: Marius Börschig <Marius.Boerschig@vector.com>
Signed-off-by: Marius Börschig <Marius.Boerschig@vector.com>
Signed-off-by: Marius Börschig <Marius.Boerschig@vector.com>
Signed-off-by: Marius Börschig <Marius.Boerschig@vector.com>
…hers into the struct

Signed-off-by: Marius Börschig <Marius.Boerschig@vector.com>
Signed-off-by: Marius Börschig <Marius.Boerschig@vector.com>
…e housekeeping alot

Signed-off-by: Marius Börschig <Marius.Boerschig@vector.com>
… handler

Signed-off-by: Marius Börschig <Marius.Boerschig@vector.com>
- Replace the catch-all Link kind with NetworkSimulatorLink, PubSubMatch and
  RpcMatch. Matches are now reported as removed: after both endpoints are
  known, and before the first endpoint's ServiceRemoved.
- Report each participant's LifecycleService and TimeSyncService.
- Rework SilKit_Experimental_ServiceDescriptor (unreleased, so not backward
  compatible): serviceId / connectedServiceId as stable keys, typed
  networkType, operationMode and timeSyncActive, an isSnapshot flag for the
  services replayed on handler registration; drop the always empty
  simulationName.
- Adapt the C++ hourglass, and extend the unit, integration and hourglass
  tests.

Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
@MariusBgm
MariusBgm force-pushed the dev_public_service_discovery_capi branch from e2e01c2 to 6bcc013 Compare October 13, 2026 14:41

@snps-kratz snps-kratz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I came up with some questions and created a small demo discovery inspector that exercises this design. I did not run into any immediate problems with that. Just some questions and minor comments.

Comment thread SilKit/include/silkit/capi/Experimental.h Outdated
Comment thread SilKit/source/capi/CapiExperimental.cpp Outdated
Comment thread SilKit/include/silkit/capi/Experimental.h Outdated

@KonradBreitsprecherBkd KonradBreitsprecherBkd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found some issues that require attention.

Comment thread SilKit/include/silkit/capi/ServiceDiscovery.h
Comment thread SilKit/source/core/service/ServiceDiscovery.cpp
Comment thread SilKit/include/silkit/capi/ServiceDiscovery.h
- Rename silkit/capi/Experimental.h to silkit/capi/ServiceDiscovery.h and
  CapiExperimental.cpp to CapiServiceDiscovery.cpp.
- SetServiceDiscoveryHandler now sets instead of adds: a participant has a
  single handler, and a later call replaces handler and context without
  replaying the known services. Setting the handler from within the
  handler fails with WRONGSTATE (C) / StateError (C++), also during the
  replay. CreateServiceDiscovery returns one observer per participant.
- Drop isSnapshot from the service descriptor: it could only mean "known
  to this participant when the handler was set", not "existed in the
  simulation". The replay stays synchronous on the calling thread before
  Set returns, and the docs say so. The late-observer ITest no longer
  depends on that race.
- A failure while replaying the known services is returned from
  SetServiceDiscoveryHandler as an error code; failures on later events
  are still swallowed.
- The C++ hourglass trampoline no longer lets exceptions unwind through
  the C ABI: a std::exception from the user handler is logged as a
  warning through the participant logger, anything else is swallowed.
- Docs: descriptor passed by pointer, labels empty when not applicable or
  not decodable, single-handler and threading contract for Set.
- Tests: single-handler and nested-Set rejection (unit, hourglass),
  throwing user handlers (hourglass), replay before Set returns (unit).

Signed-off-by: Marius Börschig <marius.boerschig@vector.com>

@KonradBreitsprecherBkd KonradBreitsprecherBkd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My concerns were addressed well.

@KonradBreitsprecherBkd KonradBreitsprecherBkd added status: ready for review Complete and waiting for a reviewer. and removed status: design proposal New design or API. Needs a design review and an agreement on the direction. labels Oct 23, 2026
@KonradBreitsprecherBkd KonradBreitsprecherBkd added status: approved Approved and waiting to be merged, for example for a release window. and removed status: ready for review Complete and waiting for a reviewer. labels Oct 23, 2026
@MariusBgm MariusBgm changed the title api: public service discovery PoC api: public service discovery experimental API Oct 23, 2026
@MariusBgm
MariusBgm merged commit 2393e41 into main Oct 23, 2026
15 checks passed
@MariusBgm
MariusBgm deleted the dev_public_service_discovery_capi branch October 23, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: approved Approved and waiting to be merged, for example for a release window.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants