You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/02/24 03:56:25 UTC

[GitHub] [airflow] mik-laj opened a new pull request #7521: [AIRFLOW-6897] Simplify DagFileProcessorManager

mik-laj opened a new pull request #7521: [AIRFLOW-6897] Simplify DagFileProcessorManager
URL: https://github.com/apache/airflow/pull/7521
 
 
   **Extract start_new_processes and prepare_file_path_queue**
   These functions are independent of each other, but as separate methods, they are easier to understand. A good methods name is the best documentation.
   I also changed to `_heartbeat_count` to `_no_run` because it better describes the role. This variable can increase without affecting heartbeat when DagFileProcessorManager is running in asynchronous mode.q
   **Move emit_metrics call**
   It is not related to generating file_path_queue, so it should be called by the caller.
   **Inline heartbeat method**
   This function does not make sense, because every time a full loop is performed.  It only hides the logic and makes it difficult to understand the code.
   **Move _kill_timed_out_processors to loop**
   It is not related to generating the collect_results method, so it should be called by the caller.
   
   Now I have the impression that the sequence of operations is much more easy to understand because it is only found in the start method.
   
   In this PR I do not want to change the sequence of operations. It is only refactoring without functional changes.
   
   ---
   Issue link: WILL BE INSERTED BY [boring-cyborg](https://github.com/kaxil/boring-cyborg)
   
   Make sure to mark the boxes below before creating PR: [x]
   
   - [X] Description above provides context of the change
   - [X] Commit message/PR title starts with `[AIRFLOW-NNNN]`. AIRFLOW-NNNN = JIRA ID<sup>*</sup>
   - [X] Unit tests coverage for changes (not needed for documentation changes)
   - [X] Commits follow "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)"
   - [X] Relevant documentation is updated including usage instructions.
   - [X] I will engage committers as explained in [Contribution Workflow Example](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#contribution-workflow-example).
   
   <sup>*</sup> For document-only changes commit message can start with `[AIRFLOW-XXXX]`.
   
   ---
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
   Read the [Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines) for more information.
   

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


With regards,
Apache Git Services

[GitHub] [airflow] mik-laj commented on a change in pull request #7521: [AIRFLOW-6897] Simplify DagFileProcessorManager

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #7521: [AIRFLOW-6897] Simplify DagFileProcessorManager
URL: https://github.com/apache/airflow/pull/7521#discussion_r383282256
 
 

 ##########
 File path: airflow/utils/dag_processing.py
 ##########
 @@ -569,7 +569,7 @@ def __init__(self,
         # Map from file path to the processor
         self._processors: Dict[str, AbstractDagFileProcessorProcess] = {}
 
-        self._heartbeat_count = 0
+        self._no_run = 0
 
 Review comment:
   I renamed this variable.

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


With regards,
Apache Git Services

[GitHub] [airflow] ashb commented on a change in pull request #7521: [AIRFLOW-6897] Simplify DagFileProcessorManager

Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #7521: [AIRFLOW-6897] Simplify DagFileProcessorManager
URL: https://github.com/apache/airflow/pull/7521#discussion_r383246546
 
 

 ##########
 File path: airflow/utils/dag_processing.py
 ##########
 @@ -569,7 +569,7 @@ def __init__(self,
         # Map from file path to the processor
         self._processors: Dict[str, AbstractDagFileProcessorProcess] = {}
 
-        self._heartbeat_count = 0
+        self._no_run = 0
 
 Review comment:
   ```suggestion
           self._num_run = 0
   ```
   
   Please? Seeing `_no_run` I expected it to be a boolean/flag variable.

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


With regards,
Apache Git Services

[GitHub] [airflow] codecov-io edited a comment on issue #7521: [AIRFLOW-6897] Simplify DagFileProcessorManager

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #7521: [AIRFLOW-6897] Simplify DagFileProcessorManager
URL: https://github.com/apache/airflow/pull/7521#issuecomment-590169752
 
 
   # [Codecov](https://codecov.io/gh/apache/airflow/pull/7521?src=pr&el=h1) Report
   > Merging [#7521](https://codecov.io/gh/apache/airflow/pull/7521?src=pr&el=desc) into [master](https://codecov.io/gh/apache/airflow/commit/0ec2774120d43fa667a371b384e6006e1d1c7821?src=pr&el=desc) will **decrease** coverage by `0.88%`.
   > The diff coverage is `88.15%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/airflow/pull/7521/graphs/tree.svg?width=650&token=WdLKlKHOAU&height=150&src=pr)](https://codecov.io/gh/apache/airflow/pull/7521?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #7521      +/-   ##
   ==========================================
   - Coverage   86.81%   85.92%   -0.89%     
   ==========================================
     Files         893      893              
     Lines       42193    42229      +36     
   ==========================================
   - Hits        36629    36285     -344     
   - Misses       5564     5944     +380
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/airflow/pull/7521?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [airflow/bin/cli.py](https://codecov.io/gh/apache/airflow/pull/7521/diff?src=pr&el=tree#diff-YWlyZmxvdy9iaW4vY2xpLnB5) | `94.73% <ø> (ø)` | :arrow_up: |
   | [airflow/cli/commands/dag\_command.py](https://codecov.io/gh/apache/airflow/pull/7521/diff?src=pr&el=tree#diff-YWlyZmxvdy9jbGkvY29tbWFuZHMvZGFnX2NvbW1hbmQucHk=) | `84.71% <100%> (ø)` | :arrow_up: |
   | [airflow/providers/amazon/aws/operators/sns.py](https://codecov.io/gh/apache/airflow/pull/7521/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYW1hem9uL2F3cy9vcGVyYXRvcnMvc25zLnB5) | `100% <100%> (ø)` | :arrow_up: |
   | [airflow/models/dagrun.py](https://codecov.io/gh/apache/airflow/pull/7521/diff?src=pr&el=tree#diff-YWlyZmxvdy9tb2RlbHMvZGFncnVuLnB5) | `95.81% <66.66%> (-0.76%)` | :arrow_down: |
   | [airflow/www/views.py](https://codecov.io/gh/apache/airflow/pull/7521/diff?src=pr&el=tree#diff-YWlyZmxvdy93d3cvdmlld3MucHk=) | `76.19% <76.19%> (-0.1%)` | :arrow_down: |
   | [airflow/providers/amazon/aws/hooks/sns.py](https://codecov.io/gh/apache/airflow/pull/7521/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYW1hem9uL2F3cy9ob29rcy9zbnMucHk=) | `96.42% <94.11%> (-3.58%)` | :arrow_down: |
   | [airflow/utils/dag\_processing.py](https://codecov.io/gh/apache/airflow/pull/7521/diff?src=pr&el=tree#diff-YWlyZmxvdy91dGlscy9kYWdfcHJvY2Vzc2luZy5weQ==) | `87.95% <96.42%> (+0.02%)` | :arrow_up: |
   | [...flow/providers/apache/cassandra/hooks/cassandra.py](https://codecov.io/gh/apache/airflow/pull/7521/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2Nhc3NhbmRyYS9ob29rcy9jYXNzYW5kcmEucHk=) | `21.51% <0%> (-72.16%)` | :arrow_down: |
   | [...w/providers/apache/hive/operators/mysql\_to\_hive.py](https://codecov.io/gh/apache/airflow/pull/7521/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2hpdmUvb3BlcmF0b3JzL215c3FsX3RvX2hpdmUucHk=) | `35.84% <0%> (-64.16%)` | :arrow_down: |
   | [airflow/kubernetes/volume\_mount.py](https://codecov.io/gh/apache/airflow/pull/7521/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZV9tb3VudC5weQ==) | `44.44% <0%> (-55.56%)` | :arrow_down: |
   | ... and [17 more](https://codecov.io/gh/apache/airflow/pull/7521/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/airflow/pull/7521?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/airflow/pull/7521?src=pr&el=footer). Last update [0ec2774...8c1feb4](https://codecov.io/gh/apache/airflow/pull/7521?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

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


With regards,
Apache Git Services

[GitHub] [airflow] codecov-io commented on issue #7521: [AIRFLOW-6897] Simplify DagFileProcessorManager

Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #7521: [AIRFLOW-6897] Simplify DagFileProcessorManager
URL: https://github.com/apache/airflow/pull/7521#issuecomment-590169752
 
 
   # [Codecov](https://codecov.io/gh/apache/airflow/pull/7521?src=pr&el=h1) Report
   > Merging [#7521](https://codecov.io/gh/apache/airflow/pull/7521?src=pr&el=desc) into [master](https://codecov.io/gh/apache/airflow/commit/0ec2774120d43fa667a371b384e6006e1d1c7821?src=pr&el=desc) will **decrease** coverage by `0.45%`.
   > The diff coverage is `96.42%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/airflow/pull/7521/graphs/tree.svg?width=650&token=WdLKlKHOAU&height=150&src=pr)](https://codecov.io/gh/apache/airflow/pull/7521?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #7521      +/-   ##
   ==========================================
   - Coverage   86.81%   86.36%   -0.46%     
   ==========================================
     Files         893      893              
     Lines       42193    42194       +1     
   ==========================================
   - Hits        36629    36439     -190     
   - Misses       5564     5755     +191
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/airflow/pull/7521?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [airflow/utils/dag\_processing.py](https://codecov.io/gh/apache/airflow/pull/7521/diff?src=pr&el=tree#diff-YWlyZmxvdy91dGlscy9kYWdfcHJvY2Vzc2luZy5weQ==) | `87.95% <96.42%> (+0.02%)` | :arrow_up: |
   | [...w/providers/apache/hive/operators/mysql\_to\_hive.py](https://codecov.io/gh/apache/airflow/pull/7521/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2hpdmUvb3BlcmF0b3JzL215c3FsX3RvX2hpdmUucHk=) | `35.84% <0%> (-64.16%)` | :arrow_down: |
   | [airflow/kubernetes/volume\_mount.py](https://codecov.io/gh/apache/airflow/pull/7521/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZV9tb3VudC5weQ==) | `44.44% <0%> (-55.56%)` | :arrow_down: |
   | [airflow/kubernetes/volume.py](https://codecov.io/gh/apache/airflow/pull/7521/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZS5weQ==) | `52.94% <0%> (-47.06%)` | :arrow_down: |
   | [airflow/security/kerberos.py](https://codecov.io/gh/apache/airflow/pull/7521/diff?src=pr&el=tree#diff-YWlyZmxvdy9zZWN1cml0eS9rZXJiZXJvcy5weQ==) | `30.43% <0%> (-45.66%)` | :arrow_down: |
   | [airflow/kubernetes/pod\_launcher.py](https://codecov.io/gh/apache/airflow/pull/7521/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3BvZF9sYXVuY2hlci5weQ==) | `47.18% <0%> (-45.08%)` | :arrow_down: |
   | [airflow/providers/mysql/operators/mysql.py](https://codecov.io/gh/apache/airflow/pull/7521/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbXlzcWwvb3BlcmF0b3JzL215c3FsLnB5) | `55% <0%> (-45%)` | :arrow_down: |
   | [...viders/cncf/kubernetes/operators/kubernetes\_pod.py](https://codecov.io/gh/apache/airflow/pull/7521/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvY25jZi9rdWJlcm5ldGVzL29wZXJhdG9ycy9rdWJlcm5ldGVzX3BvZC5weQ==) | `69.69% <0%> (-25.26%)` | :arrow_down: |
   | [airflow/kubernetes/refresh\_config.py](https://codecov.io/gh/apache/airflow/pull/7521/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3JlZnJlc2hfY29uZmlnLnB5) | `50.98% <0%> (-23.53%)` | :arrow_down: |
   | [airflow/providers/apache/hive/hooks/hive.py](https://codecov.io/gh/apache/airflow/pull/7521/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2hpdmUvaG9va3MvaGl2ZS5weQ==) | `76.02% <0%> (-1.54%)` | :arrow_down: |
   | ... and [2 more](https://codecov.io/gh/apache/airflow/pull/7521/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/airflow/pull/7521?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/airflow/pull/7521?src=pr&el=footer). Last update [0ec2774...d1a1372](https://codecov.io/gh/apache/airflow/pull/7521?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

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


With regards,
Apache Git Services

[GitHub] [airflow] mik-laj merged pull request #7521: [AIRFLOW-6897] Simplify DagFileProcessorManager

Posted by GitBox <gi...@apache.org>.
mik-laj merged pull request #7521: [AIRFLOW-6897] Simplify DagFileProcessorManager
URL: https://github.com/apache/airflow/pull/7521
 
 
   

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


With regards,
Apache Git Services