You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "dosu-bot (via GitHub)" <gi...@apache.org> on 2023/09/26 15:15:17 UTC

[GitHub] [airflow] dosu-bot commented on issue #34623: Extra Links not refresh by the "Auto-refresh"

dosu-bot commented on issue #34623:
URL: https://github.com/apache/airflow/issues/34623#issuecomment-1735756257

   _🤖_
   <!-- Answer -->
   Hello,
   
   Thank you for bringing this issue to our attention. It seems like the "Auto-refresh" feature is not refreshing the Extra Links as expected. This could be due to the `useExtraLinks` hook not being re-invoked when a new task run is in progress.
   
   In the current implementation, the `useExtraLinks` hook is invoked with the `dagId`, `taskId`, `executionDate`, `mapIndex`, and `extraLinks` as parameters. If these parameters do not change between task runs, React will not re-invoke the hook, and the extra links will not be updated.
   
   To solve this issue, we could modify the `useExtraLinks` hook or the component that uses it to ensure that it re-fetches the extra links when a new task run starts. This could be done by adding a dependency to the `useExtraLinks` hook that changes whenever a new task run starts, or by forcing a re-render of the component that uses the hook.
   
   In the context shared, the `get_extra_links` function in the `extra_link_endpoint.py` file fetches the extra links for a task instance. This function could be modified to force a refresh of the extra links whenever it is called. This could be done by adding a timestamp or a unique identifier to the parameters of the function, which would change every time a new task run starts, forcing the function to fetch the new extra links.
   
   I hope this helps. If you have any further questions, please feel free to ask.
   
   Best regards,
   Dosu
   
   ## Sources
   - [airflow/www/static/js/dag/details/taskInstance/ExtraLinks.tsx](https://github.com/apache/airflow/blob/main/airflow/www/static/js/dag/details/taskInstance/ExtraLinks.tsx)
   - [airflow/www/static/js/context/autorefresh.tsx](https://github.com/apache/airflow/blob/main/airflow/www/static/js/context/autorefresh.tsx)
   - [airflow/api_connexion/endpoints/extra_link_endpoint.py](https://github.com/apache/airflow/blob/main/airflow/api_connexion/endpoints/extra_link_endpoint.py)
   - [airflow/www/static/js/components/AutoRefresh.tsx](https://github.com/apache/airflow/blob/main/airflow/www/static/js/components/AutoRefresh.tsx)
   
   ---
   This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research.
   
   Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
   
   If you want to continue the conversation, start your reply with @dosu-bot.


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