Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 TraceAbleRequestContextStorage for ease of detect context leaks #4232
Add TraceAbleRequestContextStorage for ease of detect context leaks #4232
Changes from 25 commits
1d64827
c79b852
443e740
c431103
06c728e
0f5e5e5
bcf92df
82bb1a8
a7fd563
ea2e675
cb8dcf4
50d4127
818c166
5207a4c
d24e0a2
61e767d
449f051
4dabd01
8909ace
fdd8490
5562cfe
f124fc8
a71a725
c4a534f
3b00c2a
af31a6e
ab4de84
9f681d4
a72a9ca
d43b052
4f8a8f2
6cbcfab
89ddc46
6b4b9f9
083d560
4fb9575
7b3f3d1
9d929bf
90e6e78
a0540c8
9156898
50384a2
0fe21fd
caba3d6
1302481
9e8e10e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this class isn't part of the public api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
push()
method is invoked in a Kotlin Coroutine withArmeriaRequestCoroutineContext
,only meaningless stack traces are left. So even if we provide the stack traces of the
previous context that was leaked, it may not help to detect the leak point of a
CoroutineContext
.I figured out that kotlinx-coroutines-debug can capture
the stack traces of coroutines from which we can know the actual method.
For example:
This trick could be used to create
PendingRequestContextStackTrace
as well.Before implementing it, we need to move
ArmeriaRequestCoroutineContext
tothe core module with optional Kotlin dependency. Because Armeria has two
ArmeriaRequestCoroutineContext
implementations inarmeria-kotlin
andarmeria-grpc
.As this PR has a lot of changes already, we may support it in the f/u PR.