Add local/remote presence and configurable cloud request execution - #550
Add local/remote presence and configurable cloud request execution#550NikolayChirkov wants to merge 12 commits into
Conversation
Confirm receive schedules only after Pong, keep ONLINE until the last confirmed window closes, and retry at 1.5R/0.5R plus a 30ms guard. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…e Pong handling. Keep RX blockers on the current promised window only, project openings from selected RTT, and bound outstanding Ping attempts so a late Pong still confirms the cycle. Privileged firewall tests are opt-in. Co-authored-by: Cursor <cursoragent@cursor.com>
…regation. Local ONLINE uses expected_open + offline_detection_timeout (not rx_window). QueryPeerPresence aggregates get_client_timing over peer/observer usable servers with Offline-any / Online-all / Unknown otherwise. Co-authored-by: Cursor <cursoragent@cursor.com>
…e set. QueryPeerPresence now returns UNKNOWN when the peer Personal Cloud is unavailable, aggregates only over selected_servers() (same Local Presence contract), and re-queries recovered servers fresh. Adds unit coverage and a live A/B harness. Co-authored-by: Cursor <cursoragent@cursor.com>
Replace fixed CloudRequest timeouts and Restream-on-timeout with a runtime snapshot policy (pXX RTT x factor, retry_count, hedge_next_servers), quarantine only after attempt exhaustion, and accept late responses. QueryPeerPresence uses the client policy; Local Presence is unchanged. Co-authored-by: Cursor <cursoragent@cursor.com>
Cap retry_count to 0..31, subscribe once per server to channel_changed, and treat authenticated API errors as alive (no no-response quarantine). Co-authored-by: Cursor <cursoragent@cursor.com>
Isolate peer A via a copied exe firewall block, run 10 Local/Remote fault cycles, and poll S1 quarantine for the one-server CloudRequest path. Co-authored-by: Cursor <cursoragent@cursor.com>
…tor. Keep CloudRequestExecutionPolicy and Local/Remote Presence on top of main. Co-authored-by: Cursor <cursoragent@cursor.com>
Evict until registry and pool both have capacity; raise AE_API_PROTOCOL_MAX_PENDING_RESPONSES to 32. Co-authored-by: Cursor <cursoragent@cursor.com>
Pin ae-numeric to percentile8-tail-v1; replace permille/integer percentile with 1-byte fixed types and integer-only rank math. Co-authored-by: Cursor <cursoragent@cursor.com>
Pin ae-numeric 3ab9e73; store percentile tail as FixedPoint<uint16_t,100> and drop Exponential wire codes from policy/Presence paths. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Every ae_action should be as minimal as possible. ae_action is a piece of aether busyness logic.
So for query_peer_presence you must run on already resolved cloud and per individual server.
query_peer_presence must be on lower level of this logic hierarchy.
| : ae_context_{ae_context}, client_{&client}, peer_uid_{peer_uid} { | ||
| static_cast<void>(AllowObserverCloudFallbackForPeerPresence()); | ||
|
|
||
| auto cached = client_->cloud_manager()->GetCachedCloud(peer_uid_); |
There was a problem hiding this comment.
GetCachedCloud are usefull if you only need cached cloud.
Use GetCloud on every other cases - it also look in the cache first and then make requests for a new cloud.
| } | ||
|
|
||
| Duration QueryPeerPresence::OfflineTimeout() const noexcept { | ||
| auto policy = client_->connectivity_policy(); |
|
|
||
| Duration QueryPeerPresence::OfflineTimeout() const noexcept { | ||
| auto policy = client_->connectivity_policy(); | ||
| if (!policy) { |
There was a problem hiding this comment.
use
if(auto ptr = policy.Load(); ptr) {
// use ptr
}
else {
return default
}
| // keep draining until both the registry and the pool have capacity. | ||
| auto spins = kMaxPendingResponses * 2U; | ||
| while ((pending_responses_.full() || | ||
| pending_response_pool_.available() == 0U) && |
There was a problem hiding this comment.
available() == 0U literally means full()
| std::size_t max_retries_; | ||
| Duration request_timeout_; | ||
| TaskSubscription task_sub_; | ||
| // Snapshot at construction ? runtime policy changes do not affect this op. |
There was a problem hiding this comment.
why do request policy may be changed during runtime?
| void Restream(); | ||
|
|
||
| /** | ||
| * \brief Quarantine a server after CloudRequest response-retry exhaustion. |
There was a problem hiding this comment.
Quarantine should be only on server connection failure. What's why Restream is called on request failed. Restream - means something might be wrong with stream and must be fixed.
For server connection this means, probably, we can't be sure if this channel is working and try the next is a good idea. Or if we are sure this channel worked or if we tried all channels in a list, gave up and emit server error. Server error means there is nothing we can do on our level right now, it means highly likely the server doesn't work right now.
| * compile-time template overload. Integer-only rank (no float/ceil). | ||
| */ | ||
| [[nodiscard]] TValue PercentileValue(std::size_t percentile) const { | ||
| assert(percentile <= 100); |
There was a problem hiding this comment.
You forget about assert comment!
| /** | ||
| * \brief Percentile accessor. Rank uses integer/fixed tail math only. | ||
| */ | ||
| [[nodiscard]] TValue PercentileValue(Percentile percentile) const { |
There was a problem hiding this comment.
Why do we need a special Percentile type?
We can make this function template
template parameter T must be comparable to 100 and 0 must be multiplied by size_t and divided by 100.
Summary
Add production Local and Remote Presence, together with a configurable per-request cloud execution policy.
Local Presence
Remote Presence
QueryPeerPresencewithONLINE / OFFLINE / UNKNOWNresults.Cloud request execution policy
Add runtime policy controls for new
CloudRequestoperations:aethernet-numeric;0..31retries after the initial attempt);A soft timeout triggers retry/hedging without
Restream. A server is quarantined for no response only after its retry budget is exhausted. Authenticated API errors prove that the server is alive and do not consume the no-response budget.Additional changes
StatisticsCounter.remote_presence_liveand privileged firewall validation harnesses.Dependency
Depends on aethernetio/aethernet-numeric#14.
Validation
ctest: 26/26 PASSLive fault tests were not rerun after the final numeric representation correction; the included harnesses remain available for elevated validation.