zachliu commented on issue #17508:
URL: https://github.com/apache/airflow/issues/17508#issuecomment-2165784872
> > i'm on 2.9.2 and experiencing this too
> > whenever the creation of a dag with `dag.access_control = {"Role_A":
{"can_edit", "can_read"}}` precedes the creation of `Role_A`, the role
permissions won't be updated unless the airflow server is restart or `airflow
sync-perm --include-dags` is executed on the server.
> > I thought the reoccurring dag parsing mechanism should take care of the
permission-sync
> > ```
> > min_serialized_dag_update_interval = 30
> > min_serialized_dag_fetch_interval = 10
> > ```
>
> I think this one might simply not work this way, so I marked it as good
first issue for someone to take a look and investigate. @zachliu -> maybe you
would like to dig-in?
yes, i'm doing some initial investigation and just realized a simple fact:
the dag parsing mechanism indeed doesn't do anything unless the dag code is
changed:
https://github.com/apache/airflow/blob/f56f13442613912725d307aafc537cc76277c2d1/airflow/models/dagbag.py#L648-L649
my current bandaid solution is to have a designated dag do this every 2 mins
```python
run_this = BashOperator(
task_id="sync_perm",
bash_command="/entrypoint.sh airflow sync-perm --include-dags -v",
env={"PYTHONPATH": "/usr/local/airflow/"},
append_env=True,
)
```
--
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]