aaron-y-chen commented on code in PR #73420:
URL: https://github.com/apache/airflow/pull/73420#discussion_r4112349960


##########
go-sdk/pkg/execution/client.go:
##########
@@ -57,15 +71,63 @@ func translateApiError(err error, code string, sentinel 
error, key string) error
 // over the comm socket using msgpack-framed IPC instead of HTTP.
 type CoordinatorClient struct {
        comm *CoordinatorComm
+       // Bound at construction, not per call: the Execution API scopes the 
task
+       // state store to the caller's own task instance ("ti:self").
+       tiID string
 }
 
 var _ sdk.Client = (*CoordinatorClient)(nil)
 
 // NewCoordinatorClient creates a new client backed by the comm socket.
-func NewCoordinatorClient(comm *CoordinatorComm) *CoordinatorClient {
+func NewCoordinatorClient(comm *CoordinatorComm, tiID string) 
*CoordinatorClient {
        return &CoordinatorClient{
                comm: comm,
+               tiID: tiID,
+       }
+}
+
+// resolveDefaultExpiry returns nil ("never expires") for a retention of 0.
+// Only an absent env value falls back (the runtime was not launched by the
+// coordinator); a malformed one fails as it does in Python rather than 
silently
+// retaining keys for a different period.
+func resolveDefaultExpiry(now time.Time) (any, error) {
+       days := fallbackRetentionDays
+       if raw := os.Getenv(defaultRetentionDaysEnv); raw != "" {

Review Comment:
   How about use `os.LookupEnv` so only a missing key gets the 30-day fallback? 
For example, if the supervisor passes 
`AIRFLOW__STATE_STORE__DEFAULT_RETENTION_DAYS=""`, Go currently applies 30 
days, while Python rejects the invalid setting. An empty-value case in 
`TestResolveDefaultExpiry` would cover this.



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