[jira] [Updated] (FLINK-30179) Stop stringifying exception for logging

2022-11-23 Thread Mingliang Liu (Jira)


 [ 
https://issues.apache.org/jira/browse/FLINK-30179?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mingliang Liu updated FLINK-30179:
--
Description: 
In {{org.apache.flink.runtime.taskmanager.Task}} there are multiple places 
where we stringify an exception before logging. According to Slf4j logging, we 
can just leave the last argument as exception (or throwable) without fitting 
them into log message string with placeholders 
([doc|https://www.slf4j.org/faq.html]). Let Slf4j handles the last exception 
parameter is good as tooling can treat that differently. Our logging tool does 
not truncate the exception but truncates log message message.

So essentially:
{code:java}
LOG.debug(
"{} ({}) switched from {} to {} due to CancelTaskException: {}",
taskNameWithSubtask,
executionId,
currentState,
newState,
ExceptionUtils.stringifyException(cause));
{code}
should be
{code:java}
LOG.debug(
"{} ({}) switched from {} to {} due to CancelTaskException:",
taskNameWithSubtask,
executionId,
currentState,
newState,
cause);
{code}
Interestingly there was a [hot 
fix|https://github.com/apache/flink/commit/7eac5c62a10158ef210906deb161ac791f18d3ae]
 that deliberately changed the code from the latter to the former. This JIRA 
can track the discussion why that was needed.

  was:
In {{org.apache.flink.runtime.taskmanager.Task}} there are multiple places 
where we stringify an exception before logging. According to Slf4j logging, we 
can just leave the last argument as exception (or throwable) without fitting 
them into log message string with placeholders 
([doc|[http://example.com|https://www.slf4j.org/faq.html]]). Let Slf4j handles 
the last exception parameter is good as tooling can treat that differently. Our 
logging tool does not truncate the exception but truncates log message message.

So essentially:
{code:java}
LOG.debug(
"{} ({}) switched from {} to {} due to CancelTaskException: {}",
taskNameWithSubtask,
executionId,
currentState,
newState,
ExceptionUtils.stringifyException(cause));
{code}
should be
{code:java}
LOG.debug(
"{} ({}) switched from {} to {} due to CancelTaskException:",
taskNameWithSubtask,
executionId,
currentState,
newState,
cause);
{code}
Interestingly there was a [hot 
fix|https://github.com/apache/flink/commit/7eac5c62a10158ef210906deb161ac791f18d3ae]
 that deliberately changed the code from the latter to the former. This JIRA 
can track the discussion why that was needed.


> Stop stringifying exception for logging
> ---
>
> Key: FLINK-30179
> URL: https://issues.apache.org/jira/browse/FLINK-30179
> Project: Flink
>  Issue Type: Improvement
>  Components: Runtime / Task
>Affects Versions: 1.16.0
>Reporter: Mingliang Liu
>Priority: Minor
>  Labels: pull-request-available
>
> In {{org.apache.flink.runtime.taskmanager.Task}} there are multiple places 
> where we stringify an exception before logging. According to Slf4j logging, 
> we can just leave the last argument as exception (or throwable) without 
> fitting them into log message string with placeholders 
> ([doc|https://www.slf4j.org/faq.html]). Let Slf4j handles the last exception 
> parameter is good as tooling can treat that differently. Our logging tool 
> does not truncate the exception but truncates log message message.
> So essentially:
> {code:java}
> LOG.debug(
> "{} ({}) switched from {} to {} due to CancelTaskException: {}",
> taskNameWithSubtask,
> executionId,
> currentState,
> newState,
> ExceptionUtils.stringifyException(cause));
> {code}
> should be
> {code:java}
> LOG.debug(
> "{} ({}) switched from {} to {} due to CancelTaskException:",
> taskNameWithSubtask,
> executionId,
> currentState,
> newState,
> cause);
> {code}
> Interestingly there was a [hot 
> fix|https://github.com/apache/flink/commit/7eac5c62a10158ef210906deb161ac791f18d3ae]
>  that deliberately changed the code from the latter to the former. This JIRA 
> can track the discussion why that was needed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (FLINK-30179) Stop stringifying exception for logging

2022-11-23 Thread Mingliang Liu (Jira)


 [ 
https://issues.apache.org/jira/browse/FLINK-30179?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mingliang Liu updated FLINK-30179:
--
Description: 
In {{org.apache.flink.runtime.taskmanager.Task}} there are multiple places 
where we stringify an exception before logging. According to Slf4j logging, we 
can just leave the last argument as exception (or throwable) without fitting 
them into log message string with placeholders 
([doc|[http://example.com|https://www.slf4j.org/faq.html]]). Let Slf4j handles 
the last exception parameter is good as tooling can treat that differently. Our 
logging tool does not truncate the exception but truncates log message message.

So essentially:
{code:java}
LOG.debug(
"{} ({}) switched from {} to {} due to CancelTaskException: {}",
taskNameWithSubtask,
executionId,
currentState,
newState,
ExceptionUtils.stringifyException(cause));
{code}
should be
{code:java}
LOG.debug(
"{} ({}) switched from {} to {} due to CancelTaskException:",
taskNameWithSubtask,
executionId,
currentState,
newState,
cause);
{code}
Interestingly there was a [hot 
fix|https://github.com/apache/flink/commit/7eac5c62a10158ef210906deb161ac791f18d3ae]
 that deliberately changed the code from the latter to the former. This JIRA 
can track the discussion why that was needed.

  was:
In {{org.apache.flink.runtime.taskmanager.Task}} there are multiple places 
where we stringify an exception before logging. According to Slf4j logging, we 
can just leave the last argument as exception (or throwable) without fitting 
them into log message string with placeholders.

So essentially:
{code}
LOG.debug(
"{} ({}) switched from {} to {} due to CancelTaskException: {}",
taskNameWithSubtask,
executionId,
currentState,
newState,
ExceptionUtils.stringifyException(cause));
{code}
should be
{code}
LOG.debug(
"{} ({}) switched from {} to {} due to CancelTaskException:",
taskNameWithSubtask,
executionId,
currentState,
newState,
cause);
{code}

Interestingly there was a [hot 
fix|https://github.com/apache/flink/commit/7eac5c62a10158ef210906deb161ac791f18d3ae]
 that deliberately changed the code from the latter to the former. This JIRA 
can track the discussion why that was needed.


> Stop stringifying exception for logging
> ---
>
> Key: FLINK-30179
> URL: https://issues.apache.org/jira/browse/FLINK-30179
> Project: Flink
>  Issue Type: Improvement
>  Components: Runtime / Task
>Affects Versions: 1.16.0
>Reporter: Mingliang Liu
>Priority: Minor
>  Labels: pull-request-available
>
> In {{org.apache.flink.runtime.taskmanager.Task}} there are multiple places 
> where we stringify an exception before logging. According to Slf4j logging, 
> we can just leave the last argument as exception (or throwable) without 
> fitting them into log message string with placeholders 
> ([doc|[http://example.com|https://www.slf4j.org/faq.html]]). Let Slf4j 
> handles the last exception parameter is good as tooling can treat that 
> differently. Our logging tool does not truncate the exception but truncates 
> log message message.
> So essentially:
> {code:java}
> LOG.debug(
> "{} ({}) switched from {} to {} due to CancelTaskException: {}",
> taskNameWithSubtask,
> executionId,
> currentState,
> newState,
> ExceptionUtils.stringifyException(cause));
> {code}
> should be
> {code:java}
> LOG.debug(
> "{} ({}) switched from {} to {} due to CancelTaskException:",
> taskNameWithSubtask,
> executionId,
> currentState,
> newState,
> cause);
> {code}
> Interestingly there was a [hot 
> fix|https://github.com/apache/flink/commit/7eac5c62a10158ef210906deb161ac791f18d3ae]
>  that deliberately changed the code from the latter to the former. This JIRA 
> can track the discussion why that was needed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (FLINK-30179) Stop stringifying exception for logging

2022-11-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/FLINK-30179?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated FLINK-30179:
---
Labels: pull-request-available  (was: )

> Stop stringifying exception for logging
> ---
>
> Key: FLINK-30179
> URL: https://issues.apache.org/jira/browse/FLINK-30179
> Project: Flink
>  Issue Type: Improvement
>  Components: Runtime / Task
>Affects Versions: 1.16.0
>Reporter: Mingliang Liu
>Priority: Minor
>  Labels: pull-request-available
>
> In {{org.apache.flink.runtime.taskmanager.Task}} there are multiple places 
> where we stringify an exception before logging. According to Slf4j logging, 
> we can just leave the last argument as exception (or throwable) without 
> fitting them into log message string with placeholders.
> So essentially:
> {code}
> LOG.debug(
> "{} ({}) switched from {} to {} due to CancelTaskException: {}",
> taskNameWithSubtask,
> executionId,
> currentState,
> newState,
> ExceptionUtils.stringifyException(cause));
> {code}
> should be
> {code}
> LOG.debug(
> "{} ({}) switched from {} to {} due to CancelTaskException:",
> taskNameWithSubtask,
> executionId,
> currentState,
> newState,
> cause);
> {code}
> Interestingly there was a [hot 
> fix|https://github.com/apache/flink/commit/7eac5c62a10158ef210906deb161ac791f18d3ae]
>  that deliberately changed the code from the latter to the former. This JIRA 
> can track the discussion why that was needed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)