Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce AccessLogWriterUtil and Remove Unnecessary RequestContext Push/Pop #5985

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

yzfeng2020
Copy link
Contributor

@yzfeng2020 yzfeng2020 commented Nov 17, 2024

Motivation:

As described in #5984, there are instances of unnecessary request context push/pop operations related to access logging when the access log writer is disabled. These operations are redundant since the logging path does not need to be triggered when the writer is disabled. Optimizing this behavior reduces unnecessary overhead in such cases.

Modifications:

  • Added AccessLogWriterUtil#maybeWriteAccessLog
    • Writes access log only when TransientServiceOption#WITH_ACCESS_LOGGING is enabled and the access log writer is not disabled.
  • Updated AbstractHttpResponseHandler and HttpServerHandler

Result:

@yzfeng2020 yzfeng2020 changed the title Introduce shouldWriteAccessLog Introduce ServiceConfig#shouldWriteAccessLog Nov 17, 2024
@yzfeng2020 yzfeng2020 changed the title Introduce ServiceConfig#shouldWriteAccessLog Introduce ServiceConfig#shouldWriteAccessLog and Remove Unnecessary RequestContext Push/Pop Nov 17, 2024
@yzfeng2020 yzfeng2020 marked this pull request as ready for review November 17, 2024 05:05
@jrhee17 jrhee17 added this to the 1.31.1 milestone Nov 18, 2024
Copy link
Member

@minwoox minwoox left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks!

@yzfeng2020 yzfeng2020 force-pushed the unnecessary-push-access-logging branch from ecaaa5f to 912046f Compare November 18, 2024 06:32
@yzfeng2020 yzfeng2020 changed the title Introduce ServiceConfig#shouldWriteAccessLog and Remove Unnecessary RequestContext Push/Pop Introduce AccessLogWriterUtil and Remove Unnecessary RequestContext Push/Pop Nov 18, 2024
Copy link
Contributor

@jrhee17 jrhee17 left a comment

Choose a reason for hiding this comment

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

👍 👍

Copy link
Contributor

@ikhoon ikhoon left a comment

Choose a reason for hiding this comment

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

Thanks, @yzfeng2020! 🙇‍♂️🙇‍♂️

@jrhee17 jrhee17 merged commit 6dbed57 into line:main Nov 21, 2024
12 of 14 checks passed
minwoox pushed a commit that referenced this pull request Nov 22, 2024
…ush/Pop (#5985)

Motivation:

As described in #5984, there are
instances of unnecessary request context push/pop operations related to
access logging when the access log writer is disabled. These operations
are redundant since the logging path does not need to be triggered when
the writer is disabled. Optimizing this behavior reduces unnecessary
overhead in such cases.

Modifications:

- Added `AccessLogWriterUtil#maybeWriteAccessLog`
- Writes access log only when
`TransientServiceOption#WITH_ACCESS_LOGGING` is enabled and the access
log writer is not disabled.
- Updated `AbstractHttpResponseHandler` and `HttpServerHandler`

Result:

- Closes #5984.
- Removes unnecessary context push/pop operations for access logging
when the access log writer is disabled, resulting in a more efficient
request handling process.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unnecessary request context push/pop wrt access logging
4 participants