Navigation Menu

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

Pass ThreadContext to transport interceptors to allow header modification #22618

Merged
merged 7 commits into from Jan 15, 2017

Conversation

s1monw
Copy link
Contributor

@s1monw s1monw commented Jan 13, 2017

TransportInterceptors are commonly used to enrich requests with headers etc.
which requires access the the thread context. This is not always easily possible
since threadpools are hard to access for instance if the interceptor is used on a transport client.

This commit passes on the thread context to all the interceptors for further consumption.

Closes #22585

…tion

TransportInterceptors are commonly used to enrich requests with headers etc.
which requires access the the thread context. This is not always easily possible
since threadpools are hard to access for instance if the interceptor is used on a transport client.

This commit passes on the thread context to all the interceptors for further consumption.

Closes elastic#22585
Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -42,8 +43,12 @@
/**
* Returns a list of {@link TransportInterceptor} instances that are used to intercept incoming and outgoing
* transport (inter-node) requests. This must not return <code>null</code>
*
* @param namedWriteableRegistry registry of all named writeables registered
* @param threadContext a {@link ThreadContext} of the current nodes or clients threadpool this can be used to set additional
Copy link
Member

Choose a reason for hiding this comment

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

Nit: this - > that

@s1monw
Copy link
Contributor Author

s1monw commented Jan 13, 2017

@elasticmachine test this please

@s1monw s1monw merged commit 5f0344a into elastic:master Jan 15, 2017
@s1monw s1monw deleted the issues/22585 branch January 15, 2017 12:35
s1monw added a commit that referenced this pull request Jan 15, 2017
…tion (#22618)

TransportInterceptors are commonly used to enrich requests with headers etc.
which requires access the the thread context. This is not always easily possible
since threadpools are hard to access for instance if the interceptor is used on a transport client.

This commit passes on the thread context to all the interceptors for further consumption.

Closes #22585
s1monw added a commit that referenced this pull request Jan 15, 2017
…tion (#22618)

TransportInterceptors are commonly used to enrich requests with headers etc.
which requires access the the thread context. This is not always easily possible
since threadpools are hard to access for instance if the interceptor is used on a transport client.

This commit passes on the thread context to all the interceptors for further consumption.

Closes #22585
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Jan 16, 2017
* master:
  Do not configure a logger named level
  Inclusion of link to Multi Delete (elastic#22619)
  Fix formatting in update-by-query (elastic#22628)
  [DOCS] Fiexes typo in getting started doc
  [DOCS]cMake it clear that bulk API actions are processed sequentially on each shard rather than sequentially overall (elastic#22550)
  Indexing: Add shard id to indexing operation listener (elastic#22606)
  Cleanup handling of cgroup stats
  Pass ThreadContext to transport interceptors to allow header modification (elastic#22618)
  Log deleting indices at info level
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.

None yet

4 participants