Skip to content

quiche: prevent nested buffer watermark accounting #14259

Merged
mattklein123 merged 47 commits intoenvoyproxy:mainfrom
danzh2010:headertoolarge
Mar 30, 2021
Merged

quiche: prevent nested buffer watermark accounting #14259
mattklein123 merged 47 commits intoenvoyproxy:mainfrom
danzh2010:headertoolarge

Conversation

@danzh2010
Copy link
Copy Markdown
Contributor

@danzh2010 danzh2010 commented Dec 3, 2020

Signed-off-by: Dan Zhang danzh@google.com

Commit Message: Refactor watermark accounting logic during encodeHeaders|Data|Trailers() by wrapping the code counting buffer size before and after into a scoped object.

Additional Description: The above change fix 2problems:

  1. When the stream gets reset or connection gets closed during the scope of updating watermark buffer, the watermark accounting clean-up was nested in the another buffer updating;
  2. In gQUIC, QuicConnection::OnCanWrite() counts buffered bytes change twice against connection buffer watermark if OnCanWrite() triggers encodeHeaders().

Risk Level: low
Testing: added stream unit tests to test connection close during WriteHeaders() and WriteBodySlices() and session unit tests to test OnCanWrite() triggers encodeHeaders();

Part of #2557

Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
@alyssawilk alyssawilk self-assigned this Dec 14, 2020
@alyssawilk
Copy link
Copy Markdown
Contributor

Hey Dan, I think this didn't get a reviewer because it's tagged as a draft. Want to ping when it's ready for review?

@github-actions
Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label Jan 14, 2021
Base automatically changed from master to main January 15, 2021 23:02
@github-actions
Copy link
Copy Markdown

This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions bot closed this Jan 23, 2021
@danzh2010
Copy link
Copy Markdown
Contributor Author

Hey Dan, I think this didn't get a reviewer because it's tagged as a draft. Want to ping when it's ready for review?

I need to wait for #14246 to get in as this PR branches from it.

Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
@danzh2010
Copy link
Copy Markdown
Contributor Author

Can someone reopen this PR?

@alyssawilk alyssawilk reopened this Jan 28, 2021
@github-actions github-actions bot removed the stale stalebot believes this issue/PR has not been touched recently label Jan 28, 2021
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
@danzh2010 danzh2010 marked this pull request as ready for review February 3, 2021 05:44
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
@danzh2010
Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only
Copy link
Copy Markdown

Retrying Azure Pipelines:
Check envoy-presubmit isn't fully completed, but will still attempt retrying.
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #14259 (comment) was created by @danzh2010.

see: more, trace.

Signed-off-by: Dan Zhang <danzh@google.com>
@danzh2010
Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only
Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #14259 (comment) was created by @danzh2010.

see: more, trace.

@alyssawilk
Copy link
Copy Markdown
Contributor

still needs main merge?

Signed-off-by: Dan Zhang <danzh@google.com>
@danzh2010
Copy link
Copy Markdown
Contributor Author

still needs main merge?

sync'ed with main

Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
@danzh2010
Copy link
Copy Markdown
Contributor Author

Fixed a bug in quic pause filter. PTAL

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we just have a test isTsan() utilitiy?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added a macro TSAN_TIMEOUT_FACTOR for these 3 places.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can add this as a function and use in both places like setRouteUsingWebsocket()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Signed-off-by: Dan Zhang <danzh@google.com>
@danzh2010
Copy link
Copy Markdown
Contributor Author

Ping?

alyssawilk
alyssawilk previously approved these changes Mar 29, 2021
Copy link
Copy Markdown
Contributor

@alyssawilk alyssawilk left a comment

Choose a reason for hiding this comment

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

Please do remember I'm out Fridays so don't do reviews that day :-)

@mattklein123
Copy link
Copy Markdown
Member

Sorry can you merge main?

/wait

Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
@danzh2010
Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only
Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #14259 (comment) was created by @danzh2010.

see: more, trace.

Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks!

@mattklein123 mattklein123 merged commit 964e2a0 into envoyproxy:main Mar 30, 2021
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.

5 participants