-
Notifications
You must be signed in to change notification settings - Fork 13.9k
[FLINK-8503] [flip6] Display TaskExecutor logs and stdout files in web ui #5353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FLINK-8503] [flip6] Display TaskExecutor logs and stdout files in web ui #5353
Conversation
0b66d69 to
dac8d9b
Compare
| * @param timeout for the asynchronous operation | ||
| * @return Future which is completed with the {@link TransientBlobKey} of the uploaded file. | ||
| */ | ||
| CompletableFuture<TransientBlobKey> requestFileUpload(FileType fileType, @RpcTimeout Time timeout); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need to clean up these methods?
@Override
public CompletableFuture<TransientBlobKey> requestTaskManagerLog(Time timeout) {
// return taskExecutorGateway.requestTaskManagerLog(timeout);
throw new UnsupportedOperationException("Operation is not yet supported.");
}
@Override
public CompletableFuture<TransientBlobKey> requestTaskManagerStdout(Time timeout) {
// return taskExecutorGateway.requestTaskManagerStdout(timeout);
throw new UnsupportedOperationException("Operation is not yet supported.");
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should adapt RpcTaskManagerGateway accordingly.
| config, | ||
| handlerConfig, | ||
| resourceManagerGatewayRetriever, | ||
| transientBlobService, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need these static final variables. Can just use NoOpTransientBlobService.INSTANCE as a constructor argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, will change it.
| final InetSocketAddress currentServerAddress = serverAddress; | ||
|
|
||
| if (currentServerAddress != null) { | ||
| return new BlobClient(serverAddress, blobClientConfig); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should use currentServerAddress, or the creation can fail with an NPE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely. Good catch!
| (Void ignored, Throwable throwable) -> { | ||
| if (throwable != null) { | ||
| log.debug("Failed to transfer file from TaskExecutor {}.", taskManagerId, throwable); | ||
| fileBlobKeys.invalidate(taskManagerId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not enough to invalidate the cache, you must also send an error back to the client, or the HTTP request cannot be finished.
This will block forever if the TM is not registered:
curl -v http://localhost:9067/taskmanagers/daecac46c3f0f13b945fd2bb94438204/log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is true. Will add an error response here.
4a27bd1 to
1be552e
Compare
…b ui Introduce the AbstractHandler which takes a typed request and returns an untyped response. The AbstractRestHandler extends the AbstractHandler to add typed reponses. Introduce AbstractTaskManagerFileHandler which encapsulates the file loading logic. Upon request of a TaskManager file, the handler will trigger the file upload via the ResourceManager. The returned TransientBlobKey is then downloaded via the TransientBlobService. Once downloaded, the file is served to the client. Each transient blob key is cached for maximum duration after which it is purged and has to be reuploaded by the TaskExecutor. This closes apache#5353.
Instead of creating for each new JobManagerConnection a dedicated BlobCacheService the TaskExecutor uses a single BlobCacheService which it shares between the different JobManagerConnections. The initial BlobServer address is passed by the ResourceManager when the TaskExecutor registers at it. In order to avoid the re- creation of BlobCacheServices, this commit changes the behaviour such that one can update the BlobServer address. This closes apache#5350.
The JobManagerRunnerMockTest is completely ignored. Moreover, it tests things with heavy usage of Mockito which is hard to maintain.
This commit removes the LibraryCacheManager from the JobMaster since it is no longer needed. The JobMaster is started with the correct user code class loader and, thus, does not need the LibraryCacheManager. This commit also corrects that the BlobServer is not closed by the JobManagerServices#shutdown method. This closes apache#5352.
…b ui Introduce the AbstractHandler which takes a typed request and returns an untyped response. The AbstractRestHandler extends the AbstractHandler to add typed reponses. Introduce AbstractTaskManagerFileHandler which encapsulates the file loading logic. Upon request of a TaskManager file, the handler will trigger the file upload via the ResourceManager. The returned TransientBlobKey is then downloaded via the TransientBlobService. Once downloaded, the file is served to the client. Each transient blob key is cached for maximum duration after which it is purged and has to be reuploaded by the TaskExecutor. This closes apache#5353.
1be552e to
be8feb8
Compare
What is the purpose of the change
Introduce the AbstractHandler which takes a typed request and returns an untyped
response. The AbstractRestHandler extends the AbstractHandler to add typed reponses.
Introduce AbstractTaskManagerFileHandler which encapsulates the file loading logic.
Upon request of a TaskManager file, the handler will trigger the file upload via
the ResourceManager. The returned TransientBlobKey is then downloaded via the
TransientBlobService. Once downloaded, the file is served to the client. Each
transient blob key is cached for maximum duration after which it is purged and has
to be reuploaded by the TaskExecutor.
This PR is based on #5341
Brief change log
AbstractHandlerAbstractTaskManagerFileHandlerwhich is responsible for serving files from theTaskExecutorAbstractTaskManagerFileHandlertriggers the file upload via theResourceManagerwhich knows theTaskExecutors, additionally it caches theTransientBlobKeysin order to not always trigger a file uploadTaskManagerLogFileHandlerto serve the log fileTaskManagerStdoutFileHandlerto serve the stdout fileVerifying this change
AbstractTaskManagerFileHandlerTestDoes this pull request potentially affect one of the following parts:
@Public(Evolving): (no)Documentation