amoghrajesh commented on code in PR #68133:
URL: https://github.com/apache/airflow/pull/68133#discussion_r3393448370


##########
task-sdk/src/airflow/sdk/execution_time/context.py:
##########
@@ -600,7 +601,21 @@ def set(self, key: str, value: JsonValue, *, retention: 
timedelta | None = None)
             # wrap the value with a marker to indicate that it's stored 
externally, and include the ref to the external storage
             stored = _wrap_external_ref(ref)
 
-        SUPERVISOR_COMMS.send(SetTaskStore(ti_id=self._ti_id, key=key, 
value=stored, expires_at=expires_at))
+        msg = SetTaskStore(ti_id=self._ti_id, key=key, value=stored, 
expires_at=expires_at)
+
+        limit = conf.getint("state_store", "max_value_storage_bytes")
+        if limit > 0:
+            serialized_size = len(json.dumps(stored))
+            if serialized_size > limit:
+                log.warning(
+                    "Task store value for key %r is %d bytes, which exceeds 
configured max_value_storage_bytes=%d. "
+                    "Consider using a custom [state_store] backend to offload 
large payloads.",

Review Comment:
   Missed this cos we were rewording the config in a parallel PR, handled now



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