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

add context clear before new entry span #22

Closed
wants to merge 1 commit into from

Conversation

zijin-m
Copy link
Contributor

@zijin-m zijin-m commented Jan 12, 2021

Different requests are assigned to the same traceId causing data errors
image

Because request use old asyncState
image

So,I Add clear before newEntrySpan, Is there a better solution, or am I misunderstanding?

@wu-sheng
Copy link
Member

So,I Add clear before newEntrySpan, Is there a better solution, or am I misunderstanding?

If the context is not cleared, then this should be a bug. The entry span doesn't mean the first span.

@wu-sheng wu-sheng requested a review from kezhenxu94 January 12, 2021 07:21
@zijin-m
Copy link
Contributor Author

zijin-m commented Jan 12, 2021

So,I Add clear before newEntrySpan, Is there a better solution, or am I misunderstanding?

If the context is not cleared, then this should be a bug. The entry span doesn't mean the first span.

Yes, after my test, it seems that AsyncLocalStorage did not recreate the async context for the new request event, which caused getStore to obtain the asyncState of the previous request event, which may be related to the browser’s TCP Connection Reuse, because when I use ab or curl for test and there is no such problem

@wu-sheng
Copy link
Member

@kezhenxu94 may know more about the tech detail, but basically this fix seems not correct to me.

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