Xuanwo opened a new issue, #8880:
URL: https://github.com/apache/opendal/issues/8880
## Problem
All 10 OpenDAL services that hold a long-lived `reqsign_core::Signer`
currently clone the signer and call `.with_context(...)` on **every request**
in order to pass the dynamic `OperationContext::http_transport()` introduced in
RFC #7740:
- `core/services/s3/src/core.rs:224,259,296`
- `core/services/gcs/src/core.rs:98`
- `core/services/gcs-grpc/src/core.rs:104`
- `core/services/oss/src/core.rs:99`
- `core/services/cos/src/core.rs:73`
- `core/services/obs/src/core.rs:68`
- `core/services/tos/src/core.rs:98`
- `core/services/azblob/src/core.rs:103`
- `core/services/azdls/src/core.rs:79`
- `core/services/azfile/src/core.rs:77`
In `reqsign-core 3.3.x` (`0.20.9` line), `Signer::with_context` kept the
existing `Arc<Mutex<Option<K>>>` credential cache.
However, in `apache/reqsign` `main` (`#974` / `0a62343`, targeting `reqsign
0.21.0` / `reqsign-core 4.0.0`), `Signer::with_context` now creates a **new
isolated empty credential cache** (`self.credential =
Arc::new(Mutex::new(None))`).
### Impact on `reqsign 0.21.0` upgrade
If OpenDAL upgrades to `reqsign 0.21.0` without changing this pattern, every
call compiles cleanly, **but every single storage operation suffers a
credential cache miss** across all 10 services—repeatedly calling IMDS,
AWS/Aliyun/Volcengine STS, Google OAuth2, Azure Entra ID, or reading credential
files on every request.
## Direction to resolve
Before or as part of upgrading OpenDAL to `reqsign 0.21.0`, stop replacing
`Context` via `Signer::with_context` on every request while preserving dynamic
`OperationContext::http_transport()` composition (RFC #7740). Possible
approaches to evaluate:
1. **Bind `Signer` per transport / `Operator` composition**: an assembled
`Operator`'s `OperationContext::http_transport()` does not change between
normal requests; bind or memoize the `Signer` (or its `Context`) against the
active `HttpTransporter` identity rather than calling `with_context` per
request.
2. **Keep `Signer` bound to a long-lived `Context`**: evaluate whether a
`Service` / `Operator` lifecycle hook or an `HttpSend` adapter is cleaner under
OpenDAL's `Operator` layering rules (especially cloning an `Operator` and
overriding `HttpTransport` via a layer).
Also note the other `reqsign 0.21.0` upgrade requirements:
- Explicit `CryptoProvider` resolution on `Context` (`apache/reqsign#970`).
- Upstream coordination issues:
- https://github.com/apache/reqsign/issues/1001 (`upgrading-to-0.21.md`
warning for `Signer::with_context` cache isolation)
- https://github.com/apache/reqsign/issues/1002 (public cached credential
accessor on `Signer` needed for `b2` and `swift` Keystone)
- https://github.com/apache/reqsign/issues/1003
(`reqsign-aws-core::AssumeRoleCredentialProvider` honoring runtime `Context`)
---
*Drafted with AI assistance (Gemini 4 Neon) and verified against
`apache/opendal` and `apache/reqsign` `origin/main` (`0a62343`).*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]