[ https://issues.apache.org/jira/browse/FLINK-16597?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17061361#comment-17061361 ]
Jiayi Liao commented on FLINK-16597: ------------------------------------ [~roman_khachatryan] Behaviours in {{OutputFormatSinkFunction}} also makes sense to me. About your two points: 1. {{DataSinkTask#invoke}}: "wrap exception thrown from close", do you mean putting the 1st close call to the removed 2nd close call's location? Shouldn't we call {{tryCleanupOnError}} when the exception is thrown from the new close function? 2. {{DataSinkTask#cancel}}: I think {{cancel}} is also an error from user's perspective because the work in format is not done yet. And I guess that why Flink doesn't move {{tryCleanupOnError}} inside the catch block at the first place. > tryCleanupOnError should happen before close > -------------------------------------------- > > Key: FLINK-16597 > URL: https://issues.apache.org/jira/browse/FLINK-16597 > Project: Flink > Issue Type: Improvement > Components: Runtime / Task > Affects Versions: 1.10.0 > Reporter: Jiayi Liao > Priority: Major > > If {{DataSinkTask}} fails or throws an exception, the {{OutputFormat}} will > call {{tryCleanupOnError}} before {{close}}. But the calling order is reverse > when {{DataSinkTask}} is cancelled, which doesn't make much sense that we can > still clean the output format after it's closed. > I'm not very sure if this is a bug. But this does mislead our developers when > implementing our customized {{OutputFormat}}. cc [~sewen] -- This message was sent by Atlassian Jira (v8.3.4#803005)