You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "pdebelak (via GitHub)" <gi...@apache.org> on 2023/02/22 22:02:57 UTC

[GitHub] [airflow] pdebelak opened a new pull request, #29708: Avoid including fallback message for S3TaskHandler if streaming logs

pdebelak opened a new pull request, #29708:
URL: https://github.com/apache/airflow/pull/29708

   This checks the metadata for the log_pos and if it is present and greater than 1 it doesn't include the "Falling back to local log" message.
   
   closes: #29393
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of an existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+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 a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] mrkcohen commented on pull request #29708: Avoid including fallback message for S3TaskHandler if streaming logs

Posted by "mrkcohen (via GitHub)" <gi...@apache.org>.
mrkcohen commented on PR #29708:
URL: https://github.com/apache/airflow/pull/29708#issuecomment-1498252395

   what version of airflow will this fix be included in?


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] dimon222 commented on pull request #29708: Avoid including fallback message for S3TaskHandler if streaming logs

Posted by "dimon222 (via GitHub)" <gi...@apache.org>.
dimon222 commented on PR #29708:
URL: https://github.com/apache/airflow/pull/29708#issuecomment-1498386810

   > what version of airflow will this fix be included in?
   
   Its in amazon providers 7.3.0
   https://github.com/apache/airflow/commit/fcd3c0149f17b364dfb94c0523d23e3145976bbe


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] pgagnon commented on a diff in pull request #29708: Avoid including fallback message for S3TaskHandler if streaming logs

Posted by "pgagnon (via GitHub)" <gi...@apache.org>.
pgagnon commented on code in PR #29708:
URL: https://github.com/apache/airflow/pull/29708#discussion_r1115052220


##########
airflow/providers/amazon/aws/log/s3_task_handler.py:
##########
@@ -128,8 +128,12 @@ def _read(self, ti, try_number, metadata=None):
         if logs:
             return "".join(f"*** {x}\n" for x in messages) + "\n".join(logs), {"end_of_log": True}
         else:
+            if metadata and "log_pos" in metadata and metadata["log_pos"] > 0:
+                log = ""
+            else:
+                log = "*** Falling back to local log\n"

Review Comment:
   nit:
   ```suggestion
                   log_prefix = ""
               else:
                   log_prefix = "*** Falling back to local log\n"
   ```



##########
airflow/providers/amazon/aws/log/s3_task_handler.py:
##########
@@ -128,8 +128,12 @@ def _read(self, ti, try_number, metadata=None):
         if logs:
             return "".join(f"*** {x}\n" for x in messages) + "\n".join(logs), {"end_of_log": True}
         else:
+            if metadata and "log_pos" in metadata and metadata["log_pos"] > 0:
+                log = ""
+            else:
+                log = "*** Falling back to local log\n"
             local_log, metadata = super()._read(ti, try_number, metadata)
-            return "*** Falling back to local log\n" + local_log, metadata
+            return log + local_log, metadata

Review Comment:
   nit:
   ```suggestion
               return f"{log_prefix}{local_log}", metadata
   ```



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] dstandish commented on a diff in pull request #29708: Avoid including fallback message for S3TaskHandler if streaming logs

Posted by "dstandish (via GitHub)" <gi...@apache.org>.
dstandish commented on code in PR #29708:
URL: https://github.com/apache/airflow/pull/29708#discussion_r1115028212


##########
airflow/providers/amazon/aws/log/s3_task_handler.py:
##########
@@ -128,8 +128,12 @@ def _read(self, ti, try_number, metadata=None):
         if logs:
             return "".join(f"*** {x}\n" for x in messages) + "\n".join(logs), {"end_of_log": True}
         else:
+            if metadata and "log_pos" in metadata and metadata["log_pos"] > 0:

Review Comment:
   ```suggestion
               if metadata and metadata.get("log_pos", 0) > 0:
   ```



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] dstandish merged pull request #29708: Avoid including fallback message for S3TaskHandler if streaming logs

Posted by "dstandish (via GitHub)" <gi...@apache.org>.
dstandish merged PR #29708:
URL: https://github.com/apache/airflow/pull/29708


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org