Lyalpha edited a comment on issue #8494:
URL: https://github.com/apache/airflow/issues/8494#issuecomment-631329686


   Also finding this, apparently due to triggering same dag in same second 
(https://issues.apache.org/jira/browse/AIRFLOW-699 - apparently resolved?)
   
   ```
   from airflow.api.client.local_client import Client
   client = Client(None, None)
   client.trigger_dag(dag_id="my_dag", run_id="one"); 
client.trigger_dag(dag_id="mydag", run_id="two") 
   ```
   reproduces for me on `1.10.10`, with postgres12 `airflow` database.
   
   Being able to trigger the same dag multiple times a seconds is a 
deal-breaker - happy to help out if pointed in the right direction for this one.
   
   Edit
   ----- 
   
   As an update, it looks like `start_date` and `execution_date` are defined 
identically in the table `dag_run` 
https://github.com/apache/airflow/blob/dd9f04e152997b7cff56920cb73c1e5b710a6f9d/airflow/models/dagrun.py#L42
 and yet in this table I find `start_date` with microsecond precision, and 
`execution_date` only at second precision:
   
   ```
   id | dag_id |        execution_date         | ... |           end_date       
     |          start_date
   ---+----------------------+-----------------+ ... 
+-------------------------------+------------------------------
    1 | my_dag | 2020-05-15 15:17:36+00        | ... | 2020-05-15 
15:25:49.76816+00  | 2020-05-15 15:17:36.824217+00
   
   ```
   
   Edit 2
   -------
   
   Looks like this is the offending line for me: 
https://github.com/apache/airflow/blob/dd9f04e152997b7cff56920cb73c1e5b710a6f9d/airflow/api/common/experimental/trigger_dag.py#L110
   I guess rather than calling via the client I can call this function directly 
to change it to `replace_microseconds=False`. Hopefully you can find a solution 
when using `TriggerDagOperator`, presumably underlying it is just a call to 
this function.


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to