Skip to content

Propagate PrivacyLibAgenticContext through Carbon requests and Thrift transport headers#9778

Open
speb-meta wants to merge 1 commit into
facebook:masterfrom
speb-meta:export-D105269091
Open

Propagate PrivacyLibAgenticContext through Carbon requests and Thrift transport headers#9778
speb-meta wants to merge 1 commit into
facebook:masterfrom
speb-meta:export-D105269091

Conversation

@speb-meta
Copy link
Copy Markdown

@speb-meta speb-meta commented May 16, 2026

Summary:
X-link: facebookresearch/DCPerf#621

Propagate the PrivacyLibAgenticContext as a privacylib-propagation Thrift header from clients through mcrouter to DevProxy.

We capture the context before enqueuing the request in the mcrouter message queue. And then we set the header in the mcrouter Thrift transport layer.

Diagram:

Caller thread (RequestContext available)
    │
    ├── CacheClientImplBase::buildSingleRequest()  ← captures context here
    │   └── carbonReq.setPrivacyLibAgenticContext(serialized)
    │
    ├── RequestBuilderHelper::updateTaoRequestCommonPart()  ← also captures here (TAO-specific)
    │   └── carbonReq.setPrivacyLibAgenticContext(serialized)
    │
    ╧ ── MessageQueue ──────────────────── (RequestContext lost, but field survives)
    │
    └── ThriftTransport::sendSyncHelper()
        └── request.getPrivacyLibAgenticContext().has_value()
            └── rpcOptions.setWriteHeader("privacylib-propagation", value)

We are focusing on Thrift transport exclusively as we are trying to close gaps in DevProxy layer.

Reviewed By: ghostonhuang

Differential Revision: D105269091

…ft transport headers

Summary:
X-link: facebookresearch/DCPerf#621

Propagate the `PrivacyLibAgenticContext` as a `privacylib-propagation` Thrift header from clients through mcrouter to DevProxy.

We capture the context before enqueuing the request in the mcrouter message queue. And then we set the header in the mcrouter Thrift transport layer.

Diagram:

```
Caller thread (RequestContext available)
    │
    ├── CacheClientImplBase::buildSingleRequest()  ← captures context here
    │   └── carbonReq.setPrivacyLibAgenticContext(serialized)
    │
    ├── RequestBuilderHelper::updateTaoRequestCommonPart()  ← also captures here (TAO-specific)
    │   └── carbonReq.setPrivacyLibAgenticContext(serialized)
    │
    ╧ ── MessageQueue ──────────────────── (RequestContext lost, but field survives)
    │
    └── ThriftTransport::sendSyncHelper()
        └── request.getPrivacyLibAgenticContext().has_value()
            └── rpcOptions.setWriteHeader("privacylib-propagation", value)
```

We are focusing on Thrift transport exclusively as we are trying to close gaps in DevProxy layer.

Reviewed By: ghostonhuang

Differential Revision: D105269091
@speb-meta speb-meta force-pushed the export-D105269091 branch from ffd70d8 to 96b380b Compare May 18, 2026 16:16
speb-meta added a commit to speb-meta/DCPerf that referenced this pull request May 18, 2026
…ft transport headers (facebookresearch#621)

Summary:
X-link: facebook/hhvm#9778


Propagate the `PrivacyLibAgenticContext` as a `privacylib-propagation` Thrift header from clients through mcrouter to DevProxy.

We capture the context before enqueuing the request in the mcrouter message queue. And then we set the header in the mcrouter Thrift transport layer.

Diagram:

```
Caller thread (RequestContext available)
    │
    ├── CacheClientImplBase::buildSingleRequest()  ← captures context here
    │   └── carbonReq.setPrivacyLibAgenticContext(serialized)
    │
    ├── RequestBuilderHelper::updateTaoRequestCommonPart()  ← also captures here (TAO-specific)
    │   └── carbonReq.setPrivacyLibAgenticContext(serialized)
    │
    ╧ ── MessageQueue ──────────────────── (RequestContext lost, but field survives)
    │
    └── ThriftTransport::sendSyncHelper()
        └── request.getPrivacyLibAgenticContext().has_value()
            └── rpcOptions.setWriteHeader("privacylib-propagation", value)
```

We are focusing on Thrift transport exclusively as we are trying to close gaps in DevProxy layer.

Reviewed By: ghostonhuang

Differential Revision: D105269091
speb-meta added a commit to speb-meta/mcrouter that referenced this pull request May 18, 2026
…ft transport headers

Summary:
X-link: facebook/hhvm#9778

X-link: facebookresearch/DCPerf#621

Propagate the `PrivacyLibAgenticContext` as a `privacylib-propagation` Thrift header from clients through mcrouter to DevProxy.

We capture the context before enqueuing the request in the mcrouter message queue. And then we set the header in the mcrouter Thrift transport layer.

Diagram:

```
Caller thread (RequestContext available)
    │
    ├── CacheClientImplBase::buildSingleRequest()  ← captures context here
    │   └── carbonReq.setPrivacyLibAgenticContext(serialized)
    │
    ├── RequestBuilderHelper::updateTaoRequestCommonPart()  ← also captures here (TAO-specific)
    │   └── carbonReq.setPrivacyLibAgenticContext(serialized)
    │
    ╧ ── MessageQueue ──────────────────── (RequestContext lost, but field survives)
    │
    └── ThriftTransport::sendSyncHelper()
        └── request.getPrivacyLibAgenticContext().has_value()
            └── rpcOptions.setWriteHeader("privacylib-propagation", value)
```

We are focusing on Thrift transport exclusively as we are trying to close gaps in DevProxy layer.

Reviewed By: ghostonhuang

Differential Revision: D105269091
speb-meta added a commit to speb-meta/DCPerf that referenced this pull request May 19, 2026
…ft transport headers (facebookresearch#621)

Summary:
X-link: facebook/mcrouter#479

X-link: facebook/hhvm#9778


Propagate the `PrivacyLibAgenticContext` as a `privacylib-propagation` Thrift header from clients through mcrouter to DevProxy.

We capture the context before enqueuing the request in the mcrouter message queue. And then we set the header in the mcrouter Thrift transport layer.

Diagram:

```
Caller thread (RequestContext available)
    │
    ├── CacheClientImplBase::buildSingleRequest()  ← captures context here
    │   └── carbonReq.setPrivacyLibAgenticContext(serialized)
    │
    ├── RequestBuilderHelper::updateTaoRequestCommonPart()  ← also captures here (TAO-specific)
    │   └── carbonReq.setPrivacyLibAgenticContext(serialized)
    │
    ╧ ── MessageQueue ──────────────────── (RequestContext lost, but field survives)
    │
    └── ThriftTransport::sendSyncHelper()
        └── request.getPrivacyLibAgenticContext().has_value()
            └── rpcOptions.setWriteHeader("privacylib-propagation", value)
```

We are focusing on Thrift transport exclusively as we are trying to close gaps in DevProxy layer.

Reviewed By: ghostonhuang

Differential Revision: D105269091
speb-meta added a commit to speb-meta/mcrouter that referenced this pull request May 19, 2026
…ft transport headers (facebook#479)

Summary:

X-link: facebook/hhvm#9778

X-link: facebookresearch/DCPerf#621

Propagate the `PrivacyLibAgenticContext` as a `privacylib-propagation` Thrift header from clients through mcrouter to DevProxy.

We capture the context before enqueuing the request in the mcrouter message queue. And then we set the header in the mcrouter Thrift transport layer.

Diagram:

```
Caller thread (RequestContext available)
    │
    ├── CacheClientImplBase::buildSingleRequest()  ← captures context here
    │   └── carbonReq.setPrivacyLibAgenticContext(serialized)
    │
    ├── RequestBuilderHelper::updateTaoRequestCommonPart()  ← also captures here (TAO-specific)
    │   └── carbonReq.setPrivacyLibAgenticContext(serialized)
    │
    ╧ ── MessageQueue ──────────────────── (RequestContext lost, but field survives)
    │
    └── ThriftTransport::sendSyncHelper()
        └── request.getPrivacyLibAgenticContext().has_value()
            └── rpcOptions.setWriteHeader("privacylib-propagation", value)
```

We are focusing on Thrift transport exclusively as we are trying to close gaps in DevProxy layer.

Reviewed By: ghostonhuang

Differential Revision: D105269091
meta-codesync Bot pushed a commit to facebook/mcrouter that referenced this pull request May 19, 2026
…ft transport headers (#479)

Summary:
Pull Request resolved: #479

X-link: facebook/hhvm#9778

X-link: facebookresearch/DCPerf#621

Propagate the `PrivacyLibAgenticContext` as a `privacylib-propagation` Thrift header from clients through mcrouter to DevProxy.

We capture the context before enqueuing the request in the mcrouter message queue. And then we set the header in the mcrouter Thrift transport layer.

Diagram:

```
Caller thread (RequestContext available)
    │
    ├── CacheClientImplBase::buildSingleRequest()  ← captures context here
    │   └── carbonReq.setPrivacyLibAgenticContext(serialized)
    │
    ├── RequestBuilderHelper::updateTaoRequestCommonPart()  ← also captures here (TAO-specific)
    │   └── carbonReq.setPrivacyLibAgenticContext(serialized)
    │
    ╧ ── MessageQueue ──────────────────── (RequestContext lost, but field survives)
    │
    └── ThriftTransport::sendSyncHelper()
        └── request.getPrivacyLibAgenticContext().has_value()
            └── rpcOptions.setWriteHeader("privacylib-propagation", value)
```

We are focusing on Thrift transport exclusively as we are trying to close gaps in DevProxy layer.

Reviewed By: ghostonhuang

Differential Revision: D105269091

fbshipit-source-id: d362d4053651b95db31e758665922a8883b6a5af
meta-codesync Bot pushed a commit to facebookresearch/DCPerf that referenced this pull request May 19, 2026
…ft transport headers (#621)

Summary:
X-link: facebook/mcrouter#479

X-link: facebook/hhvm#9778

Pull Request resolved: #621

Propagate the `PrivacyLibAgenticContext` as a `privacylib-propagation` Thrift header from clients through mcrouter to DevProxy.

We capture the context before enqueuing the request in the mcrouter message queue. And then we set the header in the mcrouter Thrift transport layer.

Diagram:

```
Caller thread (RequestContext available)
    │
    ├── CacheClientImplBase::buildSingleRequest()  ← captures context here
    │   └── carbonReq.setPrivacyLibAgenticContext(serialized)
    │
    ├── RequestBuilderHelper::updateTaoRequestCommonPart()  ← also captures here (TAO-specific)
    │   └── carbonReq.setPrivacyLibAgenticContext(serialized)
    │
    ╧ ── MessageQueue ──────────────────── (RequestContext lost, but field survives)
    │
    └── ThriftTransport::sendSyncHelper()
        └── request.getPrivacyLibAgenticContext().has_value()
            └── rpcOptions.setWriteHeader("privacylib-propagation", value)
```

We are focusing on Thrift transport exclusively as we are trying to close gaps in DevProxy layer.

Reviewed By: ghostonhuang

Differential Revision: D105269091

fbshipit-source-id: d362d4053651b95db31e758665922a8883b6a5af
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.

1 participant