Blizzke opened a new issue, #38134:
URL: https://github.com/apache/airflow/issues/38134

   ### Apache Airflow version
   
   2.8.2
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   We have a number of "`@hookimpl`"-hooks that run to send out messages to 
chat channels when specific things happen (for example an `on_dag_run_failed` 
that notifies people). 
   For that, a webhook-url is needed, which is obtained from the variables (as 
it can differ per DAG and is controlled by our developers themselves, just to 
say that the config file is not an option here, nor is the environment).
   
   Because the hook is triggered from within stuffs that happen in the 
scheduler, it runs in a `CommitProhibitorGuard`-context. The `MetastoreBackend` 
uses the `@provide_session`-decorator, which tries to commit at the end and 
triggers an exception.
   
   I've been very hopefully watching #12818 (and #21283) but unfortunately it 
seems they have stalled development wise. 
   For now we had to resolve things by using the model directly with our own 
session instance, which I would love to get rid of again. So I'm adding this 
issue to try to point out that the decorator is causing problems elsewhere too.
   
   ### What you think should happen instead?
   
   Should be able to obtain a variable value in the normal way.
   
   ### How to reproduce
   
   Basically use `Variable.get()` from within a hook callback.
   
   ### Operating System
   
   linux
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Docker-Compose
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


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