You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "nothingmin (via GitHub)" <gi...@apache.org> on 2025/09/11 10:56:51 UTC
[PR] Fix Grid cache invalidation for multi-run task operations [airflow]
nothingmin opened a new pull request, #55504:
URL: https://github.com/apache/airflow/pull/55504
### Problem
Grid UI was not updating after clearing or patching task instances when
using the `include_future` or `include_past` options.(#55267 )
### Solution
- Fixed cache invalidation logic to properly refresh all affected DAG runs,
not just the current run.
- Considered precise invalidation based on past/future options, but this
required overly complex predicate logic.
- Opted for a simpler approach: invalidate all DAG Grid data whenever
multiple runs are affected.
### Related Issues
Fixes #55267
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix Grid cache invalidation for multi-run task operations [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on code in PR #55504:
URL: https://github.com/apache/airflow/pull/55504#discussion_r2342319761
##########
airflow-core/src/airflow/ui/src/queries/useClearTaskInstances.ts:
##########
@@ -78,17 +79,23 @@ export const useClearTaskInstances = ({
),
];
- const queryKeys = [
+ // Check if this clear operation affects multiple DAG runs
+ const { include_future: includeFuture, include_past: includePast } = variables.requestBody;
+ const affectsMultipleRuns = includeFuture === true || includePast === true;
+
+ const invalidateKeys = [
...taskInstanceKeys,
UseDagRunServiceGetDagRunKeyFn({ dagId, dagRunId }),
[useDagRunServiceGetDagRunsKey],
[useClearTaskInstancesDryRunKey, dagId],
[usePatchTaskInstanceDryRunKey, dagId, dagRunId],
UseGridServiceGetGridRunsKeyFn({ dagId }, [{ dagId }]),
- UseGridServiceGetGridTiSummariesKeyFn({ dagId, runId: dagRunId }, [{ dagId, runId: dagRunId }]),
+ affectsMultipleRuns
+ ? [useGridServiceGetGridTiSummariesKey, { dagId }]
+ : UseGridServiceGetGridTiSummariesKeyFn({ dagId, runId: dagRunId }),
Review Comment:
```suggestion
UseGridServiceGetGridTiSummariesKeyFn({ dagId, runId: affectsMultipleRuns ? undefined : dagRunId }),
```
I feel like this is a bit simpler?
##########
airflow-core/src/airflow/ui/src/queries/useClearTaskInstances.ts:
##########
@@ -78,17 +79,23 @@ export const useClearTaskInstances = ({
),
];
- const queryKeys = [
+ // Check if this clear operation affects multiple DAG runs
+ const { include_future: includeFuture, include_past: includePast } = variables.requestBody;
+ const affectsMultipleRuns = includeFuture === true || includePast === true;
+
+ const invalidateKeys = [
Review Comment:
Let's not rename the variables
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix Grid cache invalidation for multi-run task operations [airflow]
Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal merged PR #55504:
URL: https://github.com/apache/airflow/pull/55504
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org