uranusjr commented on a change in pull request #14823:
URL: https://github.com/apache/airflow/pull/14823#discussion_r595115475



##########
File path: airflow/models/taskinstance.py
##########
@@ -1297,9 +1297,10 @@ def signal_handler(signum, frame):  # pylint: 
disable=unused-argument
                     registered = task_copy.register_in_sensor_service(self, 
context)
                 except Exception as e:
                     self.log.warning(
-                        "Failed to register in sensor service.Continue to run 
task in non smart sensor mode."
+                        "Failed to register in sensor service."
+                        "Continue to run task in non smart sensor mode.",
+                        exc_info=True
                     )
-                    self.log.exception(e, exc_info=True)

Review comment:
       Yeah, that’s what I was thinking. If a user (say) sets logging level to 
`ERROR`, previously they’d be able to see info associated with the exception. 
Not anymore with this patch.
   
   An obvious fix would be to change this to `log.error(msg, exc_info=True)` 
instead, but that’d of course also make the warning become an error, which also 
may be problematic.
   
   Personally I think it’s probably best to keep the exception info a warning 
(i.e. your current approach) since it doesn’t really make that much sense to me 
to only show the exception traceback but not the main warning message, but this 
probably should be a decision made by someone with more knowledge on Airflow’s 
logging configs.




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