acp runtime: the queue cap's comment says it drops the newest item
This commit is contained in:
parent
e58e842a9f
commit
40ec5ac9e0
1 changed files with 7 additions and 4 deletions
|
|
@ -207,9 +207,12 @@ impl Drop for Connection {
|
|||
}
|
||||
}
|
||||
|
||||
/// How many items wait for the harness before the oldest news is dropped. A
|
||||
/// turn drains the queue as it goes, so only an agent that talks while no turn
|
||||
/// runs gets near this; its items are thrown away at the next prompt anyway.
|
||||
/// How many items wait for the harness before new ones are dropped. A turn
|
||||
/// drains the queue as it goes, so only an agent that talks while no turn runs
|
||||
/// gets near this; its items are thrown away at the next prompt anyway. Keeping
|
||||
/// the oldest and dropping the newest means a sink that stalled mid-turn for
|
||||
/// this many items would lose the latest output; that is the right side to
|
||||
/// lose for the idle case this bounds.
|
||||
const INCOMING_CAP: usize = 4096;
|
||||
|
||||
/// The sending half of the agent's output queue. A full queue drops the new
|
||||
|
|
@ -230,7 +233,7 @@ impl Feed {
|
|||
if !self.full.swap(true, Ordering::Relaxed) {
|
||||
tracing::warn!(
|
||||
cap = INCOMING_CAP,
|
||||
"ACP agent output is not being read; dropping what it sends until a turn drains it"
|
||||
"ACP agent output is not being read; dropping what it sends once the queue is full (logged once per connection)"
|
||||
);
|
||||
}
|
||||
true
|
||||
|
|
|
|||
Loading…
Reference in a new issue