-
Notifications
You must be signed in to change notification settings - Fork 168
Description
AbstractKernel inherits from UserDict[str, Any], causing a mismatch between the instance attribute and the internal UserDict data dict for container_id.
-
AbstractKernel.init initializes self.container_id = None as an instance attribute (kernel.py:232)
-
After container startup, agent.py:3066 calls self.kernel_registry[kernel_id].data.update(container_data), which only updates the UserDict data dict
-
Due to Python's attribute lookup order, the instance attribute takes precedence, so kernel_obj.container_id always returns None
-
repr(kernel_obj) uses UserDict.repr() which displays the data dict, so container_id appears to have a valid value
Impact: In collect_container_stat(), the condition kernel_obj.container_id is None evaluates to True, causing container stats collection to be skipped entirely.
Fix: Either sync the instance attribute after data.update(), or unify container_id access to always go through self.data.
JIRA Issue: BA-4891