You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2019/06/05 10:21:00 UTC

[jira] [Commented] (AIRFLOW-4527) Connection error while calling refreshfromdb() makes the task stuck in running state

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

ASF GitHub Bot commented on AIRFLOW-4527:
-----------------------------------------

bharathpalaksha commented on pull request #5373: AIRFLOW-4527 : Connection error while calling refreshfromdb() makes t…
URL: https://github.com/apache/airflow/pull/5373
 
 
   …he task stuck in running state
   
   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [ ] My PR addresses the following [Airflow Jira](https://issues.apache.org/jira/browse/AIRFLOW-4527) issues and references them in the PR title. 
   
   ### Description
   
   - [ ] Airflow with mysql as metastore. When there is a network issue, airflow tries to refresh status from db after completion of task and gets a connection error - This results in task getting stuck in running.
   
   If worker nodes are unable to reach mysql to update task status, scheduler node should handle this scenario and mark those tasks failed. Tasks shouldn't be stuck in running state for ever.
   
   Below is the stack trace, connection error with mysql has occured when refreshfromdb() is called in _run_raw_task after task completion. 
   
    Scheduler heartbeat got an exception: (MySQLdb._exceptions.OperationalError) (2013, "Lost connection to MySQL server at 'reading authorization packet', system error: 104") (Background on this error at: http://sqlalche.me/e/e3q8)
   {base_task_runner.py:101}
   INFO - Job 989226: Subtask count_cust_shipped_data File "/usr/local/bin/airflow", line 32, in <module>
   {base_task_runner.py:101}
   INFO - Job 989226: Subtask count_cust_shipped_data File "/usr/local/lib/python2.7/site-packages/airflow/utils/cli.py", line 74, in wrapper
   {base_task_runner.py:101}
   INFO - Job 989226: Subtask count_cust_shipped_data return f(*args, **kwargs)
   {base_task_runner.py:101}
   INFO - Job 989226: Subtask count_cust_shipped_data File "/usr/local/lib/python2.7/site-packages/airflow/bin/cli.py", line 526, in run
   {base_task_runner.py:101}
   INFO - Job 989226: Subtask count_cust_shipped_data _run(args, dag, ti)
   {base_task_runner.py:101}
   INFO - Job 989226: Subtask count_cust_shipped_data File "/usr/local/lib/python2.7/site-packages/airflow/bin/cli.py", line 445, in _run
   {base_task_runner.py:101}
   INFO - Job 989226: Subtask count_cust_shipped_data pool=args.pool,
   {base_task_runner.py:101}
   INFO - Job 989226: Subtask count_cust_shipped_data File "/usr/local/lib/python2.7/site-packages/airflow/utils/db.py", line 73, in wrapper
   {base_task_runner.py:101}
   INFO - Job 989226: Subtask count_cust_shipped_data return func(*args, **kwargs)
   {base_task_runner.py:101}
   **INFO - Job 989226: Subtask count_cust_shipped_data File "/usr/local/lib/python2.7/site-packages/airflow/models.py", line 1692, in _run_raw_task
   {base_task_runner.py:101}
   INFO - Job 989226: Subtask count_cust_shipped_data self.refresh_from_db()
   {base_task_runner.py:101}**
   INFO - Job 989226: Subtask count_cust_shipped_data File "/usr/local/lib/python2.7/site-packages/airflow/utils/db.py", line 73, in wrapper
   {base_task_runner.py:101}
   INFO - Job 989226: Subtask count_cust_shipped_data return func(*args, **kwargs)
   {base_task_runner.py:101}
   INFO - Job 989226: Subtask count_cust_shipped_data File "/usr/local/lib/python2.7/site-packages/airflow/models.py", line 1218, in refresh_from_db
   
   I have made scheduler identify such tasks based on execution time out set for the task and marked them for RETRY or FAILED.
   
   ### Tests
   
   - [ ] My PR adds the following unit tests:
          test_dag_run has unit test for this scenario
   
   ### Commits
   
   - [ ] My commits all reference Jira issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)":
     1. Subject is separated from body by a blank line
     1. Subject is limited to 50 characters (not including Jira issue reference)
     1. Subject does not end with a period
     1. Subject uses the imperative mood ("add", not "adding")
     1. Body wraps at 72 characters
     1. Body explains "what" and "why", not "how"
   
   ### Documentation
   
   - [ ] In case of new functionality, my PR adds documentation that describes how to use it.
     - All the public functions and the classes in the PR contain docstrings that explain what it does
     - If you implement backwards incompatible changes, please leave a note in the [Updating.md](https://github.com/apache/airflow/blob/master/UPDATING.md) so we can assign it to a appropriate release
   
   ### Code Quality
   
   - [ ] Passes `flake8`
   
 
----------------------------------------------------------------
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:
users@infra.apache.org


> Connection error while calling refreshfromdb() makes the task stuck in running state
> ------------------------------------------------------------------------------------
>
>                 Key: AIRFLOW-4527
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-4527
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: database
>            Reporter: Bharath Palaksha
>            Assignee: Bharath Palaksha
>            Priority: Major
>              Labels: mysql
>
> {{I have setup airflow with mysql as metastore. When there is a network issue and task fails with a network connection reset exception, airflow tries to refresh status from db and gets a connection error - This results in task getting stuck in running.}}
> {{There is no retry for mysql connection error and it never handles the exception}}
> If worker nodes are unable to reach mysql to update task status, scheduler node should handle this scenario and mark those tasks failed. Tasks shouldn't be stuck in running state for ever.
>  
>  Scheduler heartbeat got an exception: (MySQLdb._exceptions.OperationalError) (2013, "Lost connection to MySQL server at 'reading authorization packet', system error: 104") (Background on this error at: [http://sqlalche.me/e/e3q8])
> {base_task_runner.py:101}
> INFO - Job 989226: Subtask count_cust_shipped_data Traceback (most recent call last):
> {base_task_runner.py:101}
> INFO - Job 989226: Subtask count_cust_shipped_data File "/usr/local/bin/airflow", line 32, in <module>
> {base_task_runner.py:101}
> INFO - Job 989226: Subtask count_cust_shipped_data args.func(args)
> {base_task_runner.py:101}
> INFO - Job 989226: Subtask count_cust_shipped_data File "/usr/local/lib/python2.7/site-packages/airflow/utils/cli.py", line 74, in wrapper
> {base_task_runner.py:101}
> INFO - Job 989226: Subtask count_cust_shipped_data return f(*args, **kwargs)
> {base_task_runner.py:101}
> INFO - Job 989226: Subtask count_cust_shipped_data File "/usr/local/lib/python2.7/site-packages/airflow/bin/cli.py", line 526, in run
> {base_task_runner.py:101}
> INFO - Job 989226: Subtask count_cust_shipped_data _run(args, dag, ti)
> {base_task_runner.py:101}
> INFO - Job 989226: Subtask count_cust_shipped_data File "/usr/local/lib/python2.7/site-packages/airflow/bin/cli.py", line 445, in _run
> {base_task_runner.py:101}
> INFO - Job 989226: Subtask count_cust_shipped_data pool=args.pool,
> {base_task_runner.py:101}
> INFO - Job 989226: Subtask count_cust_shipped_data File "/usr/local/lib/python2.7/site-packages/airflow/utils/db.py", line 73, in wrapper
> {base_task_runner.py:101}
> INFO - Job 989226: Subtask count_cust_shipped_data return func(*args, **kwargs)
> {base_task_runner.py:101}
> INFO - Job 989226: Subtask count_cust_shipped_data File "/usr/local/lib/python2.7/site-packages/airflow/models.py", line 1692, in _run_raw_task
> {base_task_runner.py:101}
> INFO - Job 989226: Subtask count_cust_shipped_data self.refresh_from_db()
> {base_task_runner.py:101}
> INFO - Job 989226: Subtask count_cust_shipped_data File "/usr/local/lib/python2.7/site-packages/airflow/utils/db.py", line 73, in wrapper
> {base_task_runner.py:101}
> INFO - Job 989226: Subtask count_cust_shipped_data return func(*args, **kwargs)
> {base_task_runner.py:101}
> INFO - Job 989226: Subtask count_cust_shipped_data File "/usr/local/lib/python2.7/site-packages/airflow/models.py", line 1218, in refresh_from_db
> {base_task_runner.py:101}
> INFO - Job 989226: Subtask count_cust_shipped_data ti = qry.first()
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)