AlphaGarden commented on a change in pull request #7312:
[FLINK-11169][runtime] fix the problem of not being reloaded for jobmanager's…
URL: https://github.com/apache/flink/pull/7312#discussion_r245770156
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/files/StaticFileServerHandler.java
##########
@@ -256,13 +256,14 @@ private void respondToRequest(ChannelHandlerContext ctx,
HttpRequest request, St
}
try {
+ String filePath = file.getPath();
long fileLength = raf.length();
HttpResponse response = new
DefaultHttpResponse(HTTP_1_1, OK);
setContentTypeHeader(response, file);
// since the log and out files are rapidly changing, we
don't want to browser to cache them
- if (!(requestPath.contains("log") ||
requestPath.contains("out"))) {
Review comment:
According to this block of code in the same java file, the requestPath would
be set with empty string every time the log or stdout file is asked. This leads
to the opposite behavior to our expectation for your highlighted condition
statement.
```java
@Override
protected void respondAsLeader(ChannelHandlerContext channelHandlerContext,
RoutedRequest routedRequest, T gateway) throws Exception {
final HttpRequest request = routedRequest.getRequest();
final String requestPath;
// make sure we request the "index.html" in case there is a directory
request
if (routedRequest.getPath().endsWith("/")) {
requestPath = routedRequest.getPath() + "index.html";
}
// in case the files being accessed are logs or stdout files, find
appropriate paths.
else if (routedRequest.getPath().equals("/jobmanager/log") ||
routedRequest.getPath().equals("/jobmanager/stdout")) {
requestPath = "";
} else {
requestPath = routedRequest.getPath();
}
respondToRequest(channelHandlerContext, request, requestPath);
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services