You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Samuel Siebenmann (Jira)" <ji...@apache.org> on 2023/03/21 12:34:00 UTC

[jira] [Created] (FLINK-31542) FatalExceptionClassifier#isFatal returns false if the exception is fatal

Samuel Siebenmann created FLINK-31542:
-----------------------------------------

             Summary: FatalExceptionClassifier#isFatal returns false if the exception is fatal
                 Key: FLINK-31542
                 URL: https://issues.apache.org/jira/browse/FLINK-31542
             Project: Flink
          Issue Type: Bug
          Components: Connectors / Common
    Affects Versions: 1.16.1
            Reporter: Samuel Siebenmann


FatalExceptionClassifier#isFatal returns `false` if the passed throwable is fatal and `true` if it is not:
{code:java}
public boolean isFatal(Throwable err, Consumer<Exception> throwableConsumer){   
    if (validator.test(err)) {    
        throwableConsumer.accept(throwableMapper.apply(err));   
        return false;    
    }
    if (chainedClassifier != null) {     
        return chainedClassifier.isFatal(err, throwableConsumer);    
    } else {        
        return true;    
    }
}
{code}
([github|https://github.com/apache/flink/blob/master/flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/sink/throwable/FatalExceptionClassifier.java#L44])

However, the semantics of the method would indicate that it should return `true` if the passed throwable is fatal and `false` if it is not (i.e. the opposite of what is currently the case).

Additionally, the method name doesn't clearly indicate its side effects.



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