Commit babf2a7
fix: clear both _credentials and _user_credentials on pickle
Addresses review feedback:
- Non-picklable user-provided credentials (e.g., compute_engine with
requests.Session) broke pickle.dumps() because _user_credentials
was preserved in __getstate__. Now both _credentials and
_user_credentials are cleared; credentials re-resolve via ADC
after unpickle.
- Fork safety: _reset_runtime_state documents that user-provided
credentials are kept as-is (we cannot re-create them), while
ADC-resolved credentials are cleared for re-resolution.
- GCS client: always pass credentials explicitly when available;
GCSOffloader.__init__ always creates a client eagerly (the "lazy
restoration" claim in the previous commit was incorrect — the
pre-credentials code had the same eager behavior).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 6199e11 commit babf2a7
1 file changed
Lines changed: 17 additions & 13 deletions
Lines changed: 17 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2201 | 2201 | | |
2202 | 2202 | | |
2203 | 2203 | | |
2204 | | - | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
2205 | 2209 | | |
2206 | | - | |
2207 | | - | |
2208 | | - | |
2209 | | - | |
| 2210 | + | |
2210 | 2211 | | |
2211 | 2212 | | |
2212 | 2213 | | |
2213 | 2214 | | |
2214 | | - | |
| 2215 | + | |
2215 | 2216 | | |
2216 | 2217 | | |
2217 | 2218 | | |
| |||
2547 | 2548 | | |
2548 | 2549 | | |
2549 | 2550 | | |
2550 | | - | |
| 2551 | + | |
| 2552 | + | |
2551 | 2553 | | |
| 2554 | + | |
2552 | 2555 | | |
2553 | 2556 | | |
2554 | 2557 | | |
| |||
2557 | 2560 | | |
2558 | 2561 | | |
2559 | 2562 | | |
2560 | | - | |
2561 | | - | |
| 2563 | + | |
| 2564 | + | |
| 2565 | + | |
2562 | 2566 | | |
2563 | | - | |
2564 | | - | |
2565 | 2567 | | |
2566 | 2568 | | |
2567 | 2569 | | |
| |||
2616 | 2618 | | |
2617 | 2619 | | |
2618 | 2620 | | |
2619 | | - | |
2620 | | - | |
| 2621 | + | |
| 2622 | + | |
| 2623 | + | |
| 2624 | + | |
2621 | 2625 | | |
2622 | 2626 | | |
2623 | 2627 | | |
| |||
0 commit comments