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

AsyncIOProcessor preserve thread context #43729

Conversation

henningandersen
Copy link
Contributor

AsyncIOProcessor now preserves thread context, ensuring that deprecation
warnings are not duplicated to other concurrent operations on the same
shard.

AsyncIOProcessor now preserves thread context, ensuring that deprecation
warnings are not duplicated to other concurrent operations on the same
shard.
@henningandersen henningandersen added >bug :Distributed/Engine Anything around managing Lucene and the Translog in an open shard. v8.0.0 v7.3.0 v6.8.2 v7.2.1 labels Jun 28, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

Copy link
Contributor

@s1monw s1monw left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@ywelsch ywelsch left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -121,6 +123,16 @@ private void processList(List<Tuple<Item, Consumer<Exception>>> candidates) {
}
}

private Consumer<Exception> preserveContext(Consumer<Exception> consumer) {
ThreadContext.StoredContext storedContext = threadContext.newStoredContext(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps use threadContext.newRestorableContext(false). It's simpler.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, fixed here: acfa0d6

@henningandersen
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/default-distro

@henningandersen henningandersen merged commit b76d314 into elastic:master Jun 30, 2019
henningandersen added a commit that referenced this pull request Jul 3, 2019
AsyncIOProcessor now preserves thread context, ensuring that deprecation
warnings are not duplicated to other concurrent operations on the same
shard.
henningandersen added a commit that referenced this pull request Jul 3, 2019
AsyncIOProcessor now preserves thread context, ensuring that deprecation
warnings are not duplicated to other concurrent operations on the same
shard.
henningandersen added a commit that referenced this pull request Jul 3, 2019
AsyncIOProcessor now preserves thread context, ensuring that deprecation
warnings are not duplicated to other concurrent operations on the same
shard.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Distributed/Engine Anything around managing Lucene and the Translog in an open shard. v6.8.2 v7.2.1 v7.3.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants