What are you really trying to do?
Our current approach to mTLS certificate rotation for workers is detecting changed certificate on disk, constructing a new client and re-assigning it to worker.client. This mostly works. However, the client exposed to Activities through activity.client() returns the original client and not the one later assigned to the worker.
Describe the bug
Worker._activity_worker is constructed upon worker initialization, holds into the original client, and that client is not changed when worker.client is updated later.
Environment/Versions
- OS and processor: M1 MacOS workers.
- Temporal Version: Python SDK 1.15.0