-
Notifications
You must be signed in to change notification settings - Fork 800
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
Switch async workflow request encoding from json to thrift #5907
Switch async workflow request encoding from json to thrift #5907
Conversation
Codecov Report
Additional details and impacted files
... and 5 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Ah. Yes, we should not be relying on json except for explicit opt-in types for that exact purpose :| It's WILDLY error-prone for reasons like this. That said, why not use thrift or proto? We already have these types, and they have well-understood behavior, known versioning/etc behavior, and are far more compact. Gob's sorta terrible for many purposes. |
5d3c740
to
6da0680
Compare
Switched to thrift as it the most commonly used format in the codebase for similar purposes. |
6da0680
to
5eb0e66
Compare
5eb0e66
to
2cc4d24
Compare
What changed?
While testing async workflows in dev environment I noticed the workflow input bytes are not carried over to the final sync call. It's because request object is json marshaled by async api handlers before sent to the queue. Certain fields in our request payloads such as this one are excluded in json output because they may contain PII and can get logged.
Request objects implement
FilteredRequestBody
interface which exposesSerializeForLogging()
function to authorizers (example) and authorizer implementation can choose to log response ofSerializeForLogging()
. This is used in uber internally for audit purposes.To avoid breaking that existing "PII hiding from logs of jsonified requests" flow, I am switching encoding of async workflow requests to thrift.
Also updating the cherry pick logic of headers by carrying over all original headers as is to avoid follow up work to support context/trace propagation work for async APIs.
Why?
Carry over request and headers of async call to sync call as is.
How did you test it?
Unit tests