You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "jack (Jira)" <ji...@apache.org> on 2019/09/25 10:24:00 UTC

[jira] [Commented] (AIRFLOW-4238) Experimental API sometimes responds with Bad Request

    [ https://issues.apache.org/jira/browse/AIRFLOW-4238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16937602#comment-16937602 ] 

jack commented on AIRFLOW-4238:
-------------------------------

[~ash] Is this considered a bug or it's a no fix as expected behavior? 

> Experimental API sometimes responds with Bad Request
> ----------------------------------------------------
>
>                 Key: AIRFLOW-4238
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-4238
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: api
>    Affects Versions: 1.10.2
>            Reporter: Roger Lahaije
>            Priority: Minor
>
> We wanted to use the Airflow api to start Dag runs.
> During implementation we notices the API sometimes responded with error 400 bad request.
> The bad request appear to happen when calls are made fast after oneanother.
>  
> The following code can reproduce the bad requests
> {code:java}
> import requests
> import json
> from datetime import datetime
> start_time = datetime.now()
> def millis():
>     dt = datetime.now() - start_time
>     ms = (dt.days * 24 * 60 * 60 + dt.seconds) * 1000 + dt.microseconds / 1000.0
>     return round(ms)
> url = f'http://localhost/api/experimental/dags/some dag/dag_runs'
> for i in range(1, 40):
>     r = requests.post(url, json={'conf': {'run_task': 1}})
>     print(f"{millis()} {r.status_code}")
>     sleep(0.4)
> >> results
> 132  200
> 561  400
> 1006 200
> 1425 400
> 1870 200
> 2295 400
> 2738 200
> 3171 400
> 3594 400
> 4039 200
> ...{code}
>  
> It looks like it's only possible to call the api a maximum of once a second, which is probably due to the fact dags can only be started once a second.
>  
> Is there any way we can call the API more than 1 time a second?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)