dmvk commented on code in PR #23229:
URL: https://github.com/apache/flink/pull/23229#discussion_r1298123152
##########
flink-runtime/src/main/java/org/apache/flink/runtime/rest/FileUploadHandler.java:
##########
@@ -212,6 +212,16 @@ protected void channelRead0(final ChannelHandlerContext
ctx, final HttpObject ms
}
}
+ private static boolean hasNext(HttpPostRequestDecoder decoder) {
+ try {
+ return decoder.hasNext();
+ } catch (HttpPostRequestDecoder.EndOfDataDecoderException e) {
+ // this can occur if the final chuck wasn't empty, but didn't
contain any attribute data
+ // unfortunately the Netty APIs don't give us any way to check this
Review Comment:
the contract of hasNext method seems just awful (I'm still puzzled they
simply don't return false), but it seems that netty even recommends this
approach in examples
https://github.com/netty/netty/blob/6fc60e04649ae3873f0f52ecb3a387245215dbad/example/src/main/java/io/netty/example/http/upload/HttpUploadServerHandler.java#L252
--
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]