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

Share AsyncContext when RequestTarget*Filter(s) are used #1308

Merged
merged 1 commit into from
Jan 12, 2021

Conversation

idelpivnitskiy
Copy link
Member

Motivation:

RequestTarget*Filter(s) use Single.defer operator to modify the
request-target on each subscribe, however it doesn't share the
AsyncContext. As the result, context changes made during request
processing won't be visible during processing response payload body.

Modifications:

  • Add subscribeShareContext() operator for all RequestTarget*Filter(s);

Result:

Correct AsyncContext propagation in RequestTarget*Filter(s).

Motivation:

`RequestTarget*Filter`(s) use `Single.defer` operator to modify the
request-target on each subscribe, however it doesn't share the
`AsyncContext`. As the result, context changes made during request
processing won't be visible during processing response payload body.

Modifications:

- Add `subscribeShareContext()` operator for all `RequestTarget*Filter`(s);

Result:

Correct `AsyncContext` propagation in `RequestTarget*Filter`(s).
Copy link
Contributor

@tkountis tkountis left a comment

Choose a reason for hiding this comment

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

LGTM consider adding a test

@idelpivnitskiy
Copy link
Member Author

@tkountis good point! To avoid duplication in tests for each filter I've created #1312.

@idelpivnitskiy idelpivnitskiy merged commit 2625ae9 into apple:main Jan 12, 2021
@idelpivnitskiy idelpivnitskiy deleted the req-target-filters branch January 12, 2021 18:09
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