Skip to content

Fixing flow control events in watermark buffer#1315

Merged
mattklein123 merged 1 commit intoenvoyproxy:masterfrom
alyssawilk:watermark
Jul 24, 2017
Merged

Fixing flow control events in watermark buffer#1315
mattklein123 merged 1 commit intoenvoyproxy:masterfrom
alyssawilk:watermark

Conversation

@alyssawilk
Copy link
Copy Markdown
Contributor

Previously, low watermark events didn't fire when data was moved out of a watermark buffer. This wasn't caught by existing tests as this code path appears to not be used in the pure TCP case, but is in the H2 path.

I'm not thrilled at buffer_impl having to be mildly aware of watermark buffer's existence but this is the cleanest way I could support move semantics and also watermarks working as expected.

Copy link
Copy Markdown
Contributor

@dnoe dnoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look too unclean to me, I think it's probably the best way. The static cast you do to call postProcess() was already done a few lines earlier so this doesn't seem to be introducing a new assumption.

Looks OK to me if it is OK with @mattklein123

@mattklein123 mattklein123 merged commit 522c781 into envoyproxy:master Jul 24, 2017
@alyssawilk alyssawilk deleted the watermark branch July 25, 2017 18:27
rshriram pushed a commit to rshriram/envoy that referenced this pull request Oct 30, 2018
…yproxy#1318)

Automatic merge from submit-queue.

Use StopIterationAndWatermark instead of StopIterationAndBuffer

**What this PR does / why we need it**:Do not buffer request body during Mixer Check() call. This is to avoid buffer overflow when POST request has large body and Mixer filter is waiting for Check() response.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes envoyproxy#1315 

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
jpsim pushed a commit that referenced this pull request Nov 28, 2022
Description: Resolves a security issue flagged by GitHub.
Risk Level: Low
Testing: CI

Signed-off-by: Mike Schore <mike.schore@gmail.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit that referenced this pull request Nov 29, 2022
Description: Resolves a security issue flagged by GitHub.
Risk Level: Low
Testing: CI

Signed-off-by: Mike Schore <mike.schore@gmail.com>
Signed-off-by: JP Simard <jp@jpsim.com>
mathetake pushed a commit that referenced this pull request Mar 3, 2026
**Description**

Many AI providers have recently supported prompt caching on the provider
side. Cached token prices are significantly cheaper than normal token
processing. For example, in Open AI, cached token price is 10x cheaper
than normal token [1]. Thus, Envoy AI Gateway would like to take cached
token count into account in calculating `llmRequestCosts` in
`AIGatewayRequestCosts`.

Moreover, for self-hosted LLMs, cached tokens can drastically reduce GPU
usage. Thus, in such a case, users would like to care about cached token
usage in `llmRequestCosts`.

1: https://openai.com/api/pricing/

---------

Signed-off-by: Shingo Omura <everpeace@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants