[FLINK-9841] Web UI only show partial taskmanager log#6329
[FLINK-9841] Web UI only show partial taskmanager log#6329yanghua wants to merge 1 commit intoapache:masterfrom
Conversation
zentol
left a comment
There was a problem hiding this comment.
I doubt that the "double close" is causing it, a more likely scenario is that we're closing the file before it was completely written; after all Channel#writeAndFlush isn't blocking.
|
@zentol yes, you are right, sorry about my expression. here we should not use try-with-resource, because the listener will close the file. And it seems try-with-resource closes faster than the complete listener. |
|
@dawidwys can you review this PR? |
| // HttpChunkedInput will write the end marker (LastHttpContent) for us. | ||
| } | ||
| try { | ||
| fileLength = randomAccessFile.length(); |
There was a problem hiding this comment.
you could move this back into the following try block, like this:
try {
final long fileLength = randomAccessFile.length();
final FileChannel fileChannel = randomAccessFile.getChannel();
try {
[... actual handler code ...]
} catch (Exception e) {
fileChannel.close();
throw e;
}
} catch (IOException ioe) {
try {
randomAccessFile.close();
} catch (IOException e) {
log.warn("Error while closing file.", e);
}
}
|
@zentol this PR match your requirement? I hope it can be merged into 1.6, so that users can see the full taskmanager log. |
…itten This closes apache#6329.
…itten This closes apache#6329.
…itten This closes apache#6329.
|
@jinglining Not currently, I encountered this problem in our production environment, and I fixed it and verified it. It has been merged into Flink 1.6.0, and our current production environment version is 1.6.0. It behaves normally in our environment. What problem have you encountered? |
What is the purpose of the change
This pull request fixed a bug triggered web UI only show partial taskmanager log
Brief change log
Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
Does this pull request potentially affect one of the following parts:
@Public(Evolving): (yes / no)Documentation