Izeren commented on code in PR #27624:
URL: https://github.com/apache/flink/pull/27624#discussion_r2826737469
##########
flink-runtime/src/main/java/org/apache/flink/streaming/runtime/io/AbstractStreamTaskNetworkInput.java:
##########
@@ -316,8 +322,23 @@ public CompletableFuture<?> getAvailableFuture() {
@Override
public void close() throws IOException {
// release the deserializers . this part should not ever fail
Review Comment:
🤔, this part shouldn't ever fail and we put try-catch right after. Should we
update this comment explaining how can it fail?
##########
flink-runtime/src/main/java/org/apache/flink/streaming/runtime/io/AbstractStreamTaskNetworkInput.java:
##########
@@ -316,8 +322,23 @@ public CompletableFuture<?> getAvailableFuture() {
@Override
public void close() throws IOException {
// release the deserializers . this part should not ever fail
+ Exception err = null;
for (InputChannelInfo channelInfo : new
ArrayList<>(recordDeserializers.keySet())) {
- releaseDeserializer(channelInfo);
+ final boolean hadError =
+
checkpointedInputGate.getChannel(channelInfo.getInputChannelIdx()).hasError();
+ try {
+ releaseDeserializer(channelInfo);
+ } catch (Exception e) {
+ if (hadError) {
+ LOG.warn(
+ "Ignoring deserializer release failure - the
channel has encountered an error before");
+ } else {
+ err = e;
Review Comment:
!nit, If multiple channels throw, we will only capture the last one. Maybe
it would make sense to chain them like: `err =
ExceptionUtils.firstOrSuppressed(e, err);` or similar, WDYT
##########
flink-runtime/src/main/java/org/apache/flink/streaming/runtime/io/AbstractStreamTaskNetworkInput.java:
##########
@@ -316,8 +322,23 @@ public CompletableFuture<?> getAvailableFuture() {
@Override
public void close() throws IOException {
// release the deserializers . this part should not ever fail
+ Exception err = null;
for (InputChannelInfo channelInfo : new
ArrayList<>(recordDeserializers.keySet())) {
- releaseDeserializer(channelInfo);
+ final boolean hadError =
+
checkpointedInputGate.getChannel(channelInfo.getInputChannelIdx()).hasError();
+ try {
+ releaseDeserializer(channelInfo);
+ } catch (Exception e) {
+ if (hadError) {
+ LOG.warn(
+ "Ignoring deserializer release failure - the
channel has encountered an error before");
Review Comment:
Is there any channel info/task info we would like to log, so that we know
where this error was coming from?
##########
flink-runtime/src/main/java/org/apache/flink/streaming/runtime/io/AbstractStreamTaskNetworkInput.java:
##########
@@ -316,8 +322,23 @@ public CompletableFuture<?> getAvailableFuture() {
@Override
public void close() throws IOException {
// release the deserializers . this part should not ever fail
+ Exception err = null;
for (InputChannelInfo channelInfo : new
ArrayList<>(recordDeserializers.keySet())) {
- releaseDeserializer(channelInfo);
+ final boolean hadError =
+
checkpointedInputGate.getChannel(channelInfo.getInputChannelIdx()).hasError();
+ try {
+ releaseDeserializer(channelInfo);
+ } catch (Exception e) {
+ if (hadError) {
+ LOG.warn(
+ "Ignoring deserializer release failure - the
channel has encountered an error before");
+ } else {
+ err = e;
Review Comment:
If we do so, may make sense to add unit test covering multiple failures
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]