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

Defer trailer transformer callbacks on null msg-body to subscription. #1577

Merged
merged 1 commit into from
Jun 9, 2021

Conversation

tkountis
Copy link
Contributor

@tkountis tkountis commented May 25, 2021

Motivation:

When we have a null msg-body and call transform, then the callbacks of the trailer
transformer are invoked on the calling thread rather than the subscriber thread.

Modifications:

  • Used Publisher#defer to defer the invocation of TrailersTransformer#payloadComplete;

Result:

Better error handling in case of erroneous trailer transformer (ie. trailers validations)
and deferred execution of the callbacks until someone subscribes to the payload body.

Fix: #1576

Motivation:

When we have a null msg-body and call transform, then the callbacks of the trailer
transformer are invoked on the calling thread rather than the subsciption.

Modifications:

Used defer to defer the invocation.

Result:

Better error handling in case of erroneous trailer transformer (ie. trailers validations)
and deferred execution of the callbacks.
@tkountis tkountis requested a review from idelpivnitskiy May 25, 2021 15:12
Copy link
Member

@idelpivnitskiy idelpivnitskiy left a comment

Choose a reason for hiding this comment

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

I looked at the CI failures: https://github.com/apple/servicetalk/pull/1577/checks?check_run_id=2666777501
Never saw ConnectionCloseHeaderHandlingTest$NonPipelinedRequestsTest being flaky before this PR. Let's hold it for now?

@tkountis tkountis self-assigned this May 26, 2021
@tkountis
Copy link
Contributor Author

Build failure due #1579

@tkountis
Copy link
Contributor Author

@idelpivnitskiy as we discussed offline, we have seen this error again outside the context of this change.
PTAL at the change.

@tkountis tkountis requested a review from idelpivnitskiy May 27, 2021 10:08
Copy link
Member

@idelpivnitskiy idelpivnitskiy left a comment

Choose a reason for hiding this comment

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

🚀

@idelpivnitskiy idelpivnitskiy merged commit 4f7110b into apple:main Jun 9, 2021
bondolo pushed a commit to bondolo/servicetalk that referenced this pull request Jun 10, 2021
…pple#1577)

Motivation:

When we have a null msg-body and call `transform`, then the callbacks of the trailer
transformer are invoked on the calling thread rather than the subscriber thread.

Modifications:

- Used `Publisher#defer` to defer the invocation of `TrailersTransformer#payloadComplete`;

Result:

Better error handling in case of erroneous trailer transformer (ie. trailers validations)
and deferred execution of the callbacks until someone subscribers to payload body.
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.

StreamingHttpPayloadHolder transform invokes the payloadComplete on the caller thread.
2 participants