Bridge Request/Buffers/Recovery

Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
This commit is contained in:
Alexey
2026-09-02 18:49:10 +03:00
parent 01ffca5d34
commit 0d8d331c7c
28 changed files with 645 additions and 76 deletions
+14 -3
View File
@@ -10,6 +10,7 @@ use super::{
};
use crate::web::frame::{self, FrameType};
use crate::web::manager::ManagerError;
use crate::web::telemetry::WebSessionLifecycleObservation;
impl WebSession {
/// Polls pending downlink frames with cursor replay and newest-poll-wins semantics.
@@ -22,14 +23,19 @@ impl WebSession {
if state.closed {
return Err(ManagerError::Closed);
}
state.activity.touch_peer(Instant::now());
if let Some(unacked) = &state.unacked {
if cursor == unacked.base_cursor {
return Ok(PollResult {
let result = PollResult {
body: unacked.body.clone(),
next_cursor: unacked.next_cursor,
lane_closed: false,
});
};
self.touch_peer_locked(
&mut state,
Instant::now(),
WebSessionLifecycleObservation::HttpActivityAfterGap,
);
return Ok(result);
}
if cursor != unacked.next_cursor {
drop(state);
@@ -53,6 +59,11 @@ impl WebSession {
return Err(ManagerError::Protocol);
};
state.down_epoch = epoch;
self.touch_peer_locked(
&mut state,
Instant::now(),
WebSessionLifecycleObservation::HttpActivityAfterGap,
);
let healthy = self.carrier_health_ready_locked(&mut state, Instant::now());
(state.down_epoch, healthy)
};