-
Notifications
You must be signed in to change notification settings - Fork 5k
[DSIP-40][APIService] Add LogClient to fetch log #17165
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
Conversation
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
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.
Pull Request Overview
This pull request refactors log fetching across Worker, Master, and API services by consolidating duplicated logic into a shared LogServiceImpl and introducing a new LogClientDelegate.
- Worker and Master log services now extend LogServiceImpl to centralize log operations.
- Updated response classes in the extract module now include status code and message fields.
- LoggerServiceImpl and the new LogClientDelegate enable more robust local-remote log fetching.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/rpc/WorkerLogServiceImpl.java | Removed duplicated log fetching and extended LogServiceImpl. |
| dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/rpc/MasterLogServiceImpl.java | Updated to extend LogServiceImpl, consolidating common logic. |
| dolphinscheduler-extract/.../TaskInstanceLogPageQueryResponse.java & TaskInstanceLogFileDownloadResponse.java | Added “code” and “message” fields to support error reporting. |
| dolphinscheduler-extract/.../LogServiceImpl.java | New shared log service implementation with exception handling. |
| dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/LoggerServiceImpl.java | Integrated LogClientDelegate for better log fetching abstraction. |
| dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/executor/logging/LogClientDelegate.java | New delegate encapsulating local and remote log fetching logic. |
Comments suppressed due to low confidence (1)
dolphinscheduler-extract/dolphinscheduler-extract-common/src/main/java/org/apache/dolphinscheduler/extract/common/service/impl/LogServiceImpl.java:46
- [nitpick] Consider logging the caught exception in the catch block to provide better observability when local log retrieval fails.
byte[] bytes = LogUtils.getFileContentBytesFromLocal(taskInstanceLogFileDownloadRequest.getTaskInstanceLogAbsolutePath());
...org/apache/dolphinscheduler/extract/common/transportor/TaskInstanceLogPageQueryResponse.java
Show resolved
Hide resolved
.../apache/dolphinscheduler/extract/common/transportor/TaskInstanceLogFileDownloadResponse.java
Show resolved
Hide resolved
...er-api/src/main/java/org/apache/dolphinscheduler/api/executor/logging/LogClientDelegate.java
Outdated
Show resolved
Hide resolved
...er-api/src/main/java/org/apache/dolphinscheduler/api/executor/logging/LogClientDelegate.java
Outdated
Show resolved
Hide resolved
...er-api/src/main/java/org/apache/dolphinscheduler/api/executor/logging/LogClientDelegate.java
Outdated
Show resolved
Hide resolved
...duler-api/src/main/java/org/apache/dolphinscheduler/api/executor/logging/LocalLogClient.java
Outdated
Show resolved
Hide resolved
...er-api/src/main/java/org/apache/dolphinscheduler/api/executor/logging/LogClientDelegate.java
Outdated
Show resolved
Hide resolved
...on/src/main/java/org/apache/dolphinscheduler/extract/common/service/impl/LogServiceImpl.java
Outdated
Show resolved
Hide resolved
...on/src/main/java/org/apache/dolphinscheduler/extract/common/service/impl/LogServiceImpl.java
Outdated
Show resolved
Hide resolved
b146d9c to
34d4316
Compare
|
@ruanwenjun @SbloodyS @caishunfeng |
7e7bf79 to
074f863
Compare
ruanwenjun
left a comment
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.
LGTM, we need to support cut-off the log when fetch whole log. I create a new issue #17204
…tch local logs first; if that fails, pull from the remote. 2.The logic in MasterLogServiceImpl and WorkerLogServiceImpl is the same. Abstract the shared logic into LoggerServiceImpl to maintain a single codebase.
ruanwenjun
left a comment
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.
LGTM
|
|
@SbloodyS PTAL |
SbloodyS
left a comment
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.
+1



1.Pull local and remote task logs via the LogClientDelegate proxy. Fetch local logs first; if that fails, pull from the remote.
2.The logic in MasterLogServiceImpl and WorkerLogServiceImpl is the same. Abstract the shared logic into LoggerServiceImpl to maintain a single codebase.
close #15966
Purpose of the pull request
Brief change log
Verify this pull request
This pull request is code cleanup without any test coverage.
(or)
This pull request is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(or)