Commit

A clone answered from the pack cache is served before the free operation cap: it is not an operation

syntaqxcommitted Parentc33156aBrowse files
1 file+8−60/1 viewed
+8−6
15581558 }
15591559 };
15601560 timing.mark("kept");
1561− if let Some((response, status, message)) = limited? {
1562− after.ended(status, Some(message.to_owned()));
1563− after.spawn(env, ctx);
1564− return Ok(response);
1565− }
1561+ // A kept pack first: it never reaches the store, so it is never an
1562+ // operation, and a free workspace past its operation cap still gets
1563+ // it. (The other limits are a push's, and a pack is only a fetch.)
15661564 if let Some(kept) = pack {
15671565 timing.note("pack", "hit");
1568− // Never reached the store: never an operation.
15691566 let sent = body.as_ref().map_or(0, |body| body.len() as u64);
15701567 meters::record(pack_cache::HIT, &key, sent, kept.size);
15711568 after.ended(200, None);
15721569 after.spawn(env, ctx);
15731570 return kept.response();
15741571 }
1572+ if let Some((response, status, message)) = limited? {
1573+ after.ended(status, Some(message.to_owned()));
1574+ after.spawn(env, ctx);
1575+ return Ok(response);
1576+ }
15751577 if pack_key.is_some() {
15761578 timing.note("pack", "miss");
15771579 }