See also
The introspection protocol allows discovering participants, processes and hosts participating in a running RSB system, including some information about their respective states and properties. The “meta-communication” of the introspection protocol is implemented using the same transports and events as “ordinary” participants (i.e. there are no special-purpose communication channels for introspection).
RSB implementations as well as individual participants are encouraged but not required to support this introspection protocol.
The introspection communication pattern consists of two roles:
LocalIntrospection
Objects of this kind collect information about
- participants in a single process
- the process itself
- and the host on which the process is executed
and make it available for RemoteIntrospection objects.
RemoteIntrospection
Objects of this kind use the introspection protocol to query LocalIntrospection objects collecting information about all (introspectable) participants, processes and hosts in an entire system.
Note
participants that are part of the implementation of the introspection mechanism should not support introspection themselves. Otherwise infinite chains of meta-participants would arise.
The participant introspection protocol uses the following (reserved) scopes:
scope /__rsb/introspection/participants/
scope /__rsb/introspection/participants/ID
where ID is the string representation (of the form GROUP1-GROUP2-GROUP3-GROUP4-GROUP5, as specified in RFC 4122, for example /__rsb/introspection/participants/AC259445-0EE4-4164-A5A5-EB08EC5B325D/) of the unique id of a participant. These scopes are used for requesting and sending information about individual participants.
When a participant with unique id ID is created, an event is sent to the scope /__rsb/introspection/participants/ID
The payload is an rsb.protocol.introspection.Hello object:
As described in the documentation of the message definitions, the payload contains information regarding the participant, its process and host.
It should be noted that the host id and process id contained in the payload can be used to construct the scope under which the process can be introspected (See Process and Host Introspection).
The method field is empty
The causal vector is empty
When a participant with unique id ID is destroyed, an event is sent to the scope /__rsb/introspection/participants/ID
The payload is an rsb.protocol.introspection.Bye object:
As described in the documentation of the message definition, the only information contained in the payload is the unique id of the participant.
The method field is empty
The causal vector is empty
Note
The only difference between introspection broadcasts and responses to introspection surveys is the contents of the causal vector. Processors of introspection broadcasts and responses (e.g. RemoteIntrospection objects) may choose to ignore this difference and process all such events in the same way.
The process and host introspection protocol uses the following (reserved) scopes:
scope /__rsb/introspection/hosts/HOST-ID/PROCESS-ID
where HOST-ID is the unique id of the host on which the current process is executed and PROCESS-ID is its unique id within the host. See the documentation of the rsb.protocol.operatingsystem.Host message for construction of HOST-ID.
Examples:
- /__rsb/introspection/hosts/6116ead66a78e7d2970e5380479796df/1884/
- /__rsb/introspection/hosts/ferberit/42/
Each process that supports RSB introspection operates a remote server on this scope iff there is at least one active participant in the process. This remote server provides the following methods:
Send any received event back to the caller with the following timestamps added:
Note
The introspection mechanism cannot directly discover hosts and processes. Instead, the first participant of a process that is announced via an event containing a rsb.protocol.introspection.Hello payload indicates the existence of its process (and potentially the host on which the process is executed).
RemoteIntrospection objects call the above method periodically to determine whether a remote process is still running, detect crashes and estimate offsets between the local clock and remote clocks.
Language | File(s) |
---|---|
C++ | “0.11” branch of https://code.cor-lab.org/git/rsb.git.cpp at src/rsb/introspection/ |
Java | not implemented yet |
Python | /../rsb-python/rsb/introspection/__init__.py |
Common Lisp | “0.11” branch of https://code.cor-lab.org/git/rsb.git.cl at src/introspection/ |