Prevent ThreadContext header leak when sending response#68649
Merged
pgomulka merged 14 commits intoelastic:masterfrom Apr 13, 2022
Merged
Prevent ThreadContext header leak when sending response#68649pgomulka merged 14 commits intoelastic:masterfrom
pgomulka merged 14 commits intoelastic:masterfrom
Conversation
Contributor
Author
|
@elasticmachine update branch |
Contributor
Author
|
ok to test |
Contributor
Author
|
@elasticmachine update branch |
Contributor
Author
|
TODO - add those assertions back https://github.com/elastic/elasticsearch/pull/84751/files#r821480480 |
Collaborator
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
Collaborator
|
Hi @pgomulka, I've created a changelog YAML for you. |
DaveCTurner
reviewed
Apr 11, 2022
Member
DaveCTurner
left a comment
There was a problem hiding this comment.
Looks good assuming CI is happy. I left one small request.
| private ThreadPool threadPool; | ||
|
|
||
| public Netty4WriteThrottlingHandler() {} | ||
| public Netty4WriteThrottlingHandler(ThreadPool threadPool) { |
Member
There was a problem hiding this comment.
I'd rather capture just the ThreadContext itself here, not the whole ThreadPool.
…ulka/elasticsearch into thread_context_response_header_leak
pgomulka
added a commit
to pgomulka/elasticsearch
that referenced
this pull request
Apr 13, 2022
We need to stash thread context in DefaultRestChannel before we call channel.sendResponse because when calling this method, our execution might be delayed and the thread be reused for another task - like sending another response. And it would see thread context from the initial “delayed” work. This commit also expands the assertions on the empty thread context to make sure it does not contains response headers. closes elastic#68278
Collaborator
💔 Backport failed
You can use sqren/backport to manually backport by running |
pgomulka
added a commit
to pgomulka/elasticsearch
that referenced
this pull request
Apr 13, 2022
We need to stash thread context in DefaultRestChannel before we call channel.sendResponse because when calling this method, our execution might be delayed and the thread be reused for another task - like sending another response. And it would see thread context from the initial “delayed” work. This commit also expands the assertions on the empty thread context to make sure it does not contains response headers. closes elastic#68278
pgomulka
added a commit
that referenced
this pull request
Apr 13, 2022
…) (#85865) We need to stash thread context in DefaultRestChannel before we call channel.sendResponse because when calling this method, our execution might be delayed and the thread be reused for another task - like sending another response. And it would see thread context from the initial “delayed” work. This commit also expands the assertions on the empty thread context to make sure it does not contains response headers. closes #68278
pgomulka
added a commit
that referenced
this pull request
Apr 13, 2022
…) (#85860) We need to stash thread context in DefaultRestChannel before we call channel.sendResponse because when calling this method, our execution might be delayed and the thread be reused for another task - like sending another response. And it would see thread context from the initial “delayed” work. This commit also expands the assertions on the empty thread context to make sure it does not contains response headers. closes #68278
weizijun
added a commit
to weizijun/elasticsearch
that referenced
this pull request
Apr 13, 2022
…n/elasticsearch into datastream-reuse-pipeline-source * 'datastream-reuse-pipeline-source' of github.com:weizijun/elasticsearch: (28 commits) Add JDK 19 to Java testing matrix [ML] add nlp config update serialization tests (elastic#85867) [ML] A text categorization aggregation that works like ML categorization (elastic#80867) [ML] Fix serialisation of text embedding updates (elastic#85863) TSDB: fix wrong initial value of tsidOrd in TimeSeriesIndexSearcher (elastic#85713) Enforce external id uniqueness during DesiredNode construction (elastic#84227) Fix Intellij integration (elastic#85866) Upgrade Azure SDK to version 12.14.4 (elastic#83884) [discovery-gce] Fix initialisation of transport in FIPS mode (elastic#85817) Remove unnecessary docs/changelog/85534.yaml Prevent ThreadContext header leak when sending response (elastic#68649) Add support for impact_areas to health impacts (elastic#85830) Reduce port range re-use in tests (elastic#85777) Fix TranslogTests#testStats (elastic#85828) Remove hppc from cat allocation api (elastic#85842) Fix BuildTests serialization (elastic#85827) Use urgent priority for node shutdown cluster state update (elastic#85838) Remove Task classes from HLRC (elastic#85835) Remove unused migration classes (elastic#85834) Remove uses of Charset name parsing (elastic#85795) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
We need to stash thread context in
DefaultRestChannelbefore we callchannel.sendResponsebecause when calling this method, our execution might be delayed and the thread be reused for another task - like sending another response. And it would see thread context from the initial “delayed” work.This commit also expands the assertions on the empty thread context to make sure it does not contains response headers.
closes #68278