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

Fix netty connection keep alive #385

Merged
merged 3 commits into from
Jun 15, 2023
Merged

Conversation

shashank11p
Copy link
Contributor

When a client used Connection: keep-alive header, only the first request was being captured. Subsequent requests were using the same context and so we were adding data in the same first span that was ended.

We are setting the context as null when we end the span, so that whenever a new request comes, no matter, it will create a new context and a new span.

Tested this for both connection keep-alive and close.

@@ -103,6 +103,10 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise prm) {
span.setStatus(code >= 100 && code < 500 ? StatusCode.UNSET : StatusCode.ERROR);
}
if (msg instanceof LastHttpContent) {
ctx.channel()

Choose a reason for hiding this comment

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

Sounds like this could use some comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added

@shashank11p shashank11p merged commit b741811 into main Jun 15, 2023
@shashank11p shashank11p deleted the fixNettyConnectionKeepAlive branch June 15, 2023 15:18
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.

2 participants