You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We expect the RecoveryConfig to be configured as either the heartbeat or the periodic_queries in our current design. To achieve this, we use the following magic trick and introduce some condition checks in the runtime.
However, users could construct an empty config by RecoveryConfig::default surprisingly marked as Configured. For instance,
let subscriber = session
.declare_subscriber(key_expr).history(HistoryConfig::default().detect_late_publishers()).recovery(RecoveryConfig::default())// <-- with two default None values inside and resolved as Configured.subscriber_detection().await.unwrap();
RecoveryConfig does not need to be configured as either the heartbeat or the periodic_queries.
Recovery by default detects misses through the sequence_numbers and so don't need heartbeat or periodic_queries. This is what you get with .recovery(RecoveryConfig::default()). This works well for periodic publications, but for sporadic publications you may miss the last sample and not be able to detect it. We provide 2 ways of detecting last sample miss: heartbeat or periodic_queries that we want to be mutually exclusive (we don't want to allow users to activate both).
So to summarize: we currently have 3 recovery modes:
recovery(RecoveryConfig::default()): sample miss detection based on sequence_numbers only.
recovery(RecoveryConfig::heartbeat()): sample miss detection based on sequence_numbers and heartbeat.
recovery(RecoveryConfig:: periodic_queries()): sample miss detection based on sequence_numbers and periodic queries.
Describe the release item
We expect the
RecoveryConfig
to be configured as either the heartbeat or the periodic_queries in our current design. To achieve this, we use the following magic trick and introduce some condition checks in the runtime.However, users could construct an empty config by
RecoveryConfig::default
surprisingly marked asConfigured
. For instance,this means recovery is used but does nothing.
Moreover, it doesn't align with the c/cpp behavior. https://github.com/eclipse-zenoh/zenoh-c/blob/cdc53527c88c5d27b35fa5d4552560a06f287e44/src/advanced_subscriber.rs#L91-L105
The default recovery option is set to heartbeat and users can't configure it explicitly since it's not exposed in c/cpp due to the generic type used in Rust.
I would suggest using the following isomorphic enum to avoid unnecessary complexity and solve the above API misalignment issue effortlessly.
The text was updated successfully, but these errors were encountered: