Skip to content

Conversation

@det101
Copy link
Contributor

@det101 det101 commented May 7, 2025

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)

Copy link
Contributor

Copilot AI left a 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.

@nielifeng nielifeng requested a review from Copilot May 9, 2025 09:51
Copy link
Contributor

Copilot AI left a 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());

@SbloodyS SbloodyS added the DSIP label May 9, 2025
@SbloodyS SbloodyS added this to the 3.3.1 milestone May 9, 2025
@det101 det101 force-pushed the DSIP-40 branch 2 times, most recently from b146d9c to 34d4316 Compare May 15, 2025 02:42
@det101 det101 requested a review from ruanwenjun May 15, 2025 03:23
@det101
Copy link
Contributor Author

det101 commented May 19, 2025

@ruanwenjun @SbloodyS @caishunfeng
Please help review if there are any problems

@det101 det101 force-pushed the DSIP-40 branch 2 times, most recently from 7e7bf79 to 074f863 Compare May 22, 2025 07:32
Copy link
Member

@ruanwenjun ruanwenjun left a 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

@ruanwenjun ruanwenjun added the improvement make more easy to user or prompt friendly label May 23, 2025
luxl added 5 commits June 9, 2025 09:35
…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.
Copy link
Member

@ruanwenjun ruanwenjun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 9, 2025

@ruanwenjun
Copy link
Member

@SbloodyS PTAL

Copy link
Member

@SbloodyS SbloodyS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@SbloodyS SbloodyS merged commit 7a8d910 into apache:dev Jun 10, 2025
71 checks passed
@det101 det101 deleted the DSIP-40 branch August 27, 2025 02:17
davidzollo pushed a commit to davidzollo/dolphinscheduler that referenced this pull request Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend DSIP improvement make more easy to user or prompt friendly priority:middle test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DSIP-40][APIService] Add LogClient to fetch log

3 participants