vatsrahul1001 commented on PR #68819:
URL: https://github.com/apache/airflow/pull/68819#issuecomment-4766372857

   Thanks @amoghrajesh — agreed on the "wrong layer" point, switched away from 
serialize/deserialize. I went with your in-place approach but with one 
correction.
   
   **Nulling `local_vars_configuration` breaks worker-side reconcile.** When I 
tested `local_vars_configuration = None` on a real in-cluster deployment, 
`run_next` → `PodGenerator.construct_pod` → `reconcile_specs` failed:
   
   ```
   File ".../kubernetes/client/models/v1_pod_spec.py", line 349, in containers
       if self.local_vars_configuration.client_side_validation and containers 
is None:
   AttributeError: 'NoneType' object has no attribute 'client_side_validation'
   ```
   
   The model setters hit during `reconcile_pods` dereference 
`self.local_vars_configuration.client_side_validation`, so `None` raises and 
the task fails with `PodReconciliationError`.
   
   **Fix: reset it to a fresh `Configuration()` instead of `None`** — exactly 
what v35 model constructors produced. That's picklable (no in-cluster 
`refresh_api_key_hook`) **and** keeps `client_side_validation`, so reconcile 
works. Implemented as `_reset_local_vars_configuration` (recursive), called on 
`kube_executor_config` before `task_queue.put`. As you noted, `from_obj` 
returns the same object referenced by the workload's `executor_config`, so the 
single call covers both; the pod keeps its `V1Pod` type through the queue, so 
`run_next` is unchanged.
   
   Validated on the deployment (no crash, task runs/finishes) and added a 
regression test that asserts both **picklability** and that 
**`run_next`/`reconcile_pods` succeeds** (the assertion the `None` approach 
fails). Full executor suite green.
   
   Root cause is the v36 model-constructor change (`Configuration()` → 
`Configuration.get_default_copy()`, kubernetes-client/python#2532 / 
OpenAPITools/openapi-generator#8500); tracked in #68827.
   
   ---
   Drafted-by: Claude Code (Opus 4.8); reviewed by @vatsrahul1001 before posting


-- 
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]

Reply via email to