Skip to content
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

[GOBBLIN-2190] Implement ActivityType & add HeartBeat for Temporal Activities #4093

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

Blazer-007
Copy link
Member

@Blazer-007 Blazer-007 commented Jan 23, 2025

Dear Gobblin maintainers,

Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!

JIRA

Description

  • Here are some details about my PR, including screenshots (if applicable):
    Implemented ActivityConfigurationStrategy
    Created ActivityType Enum
    Refactored the interfaces to pass properties

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason:
    ActivityConfigurationStrategyTest
    TemporalActivityUtilsTest

Commits

  • My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

@Blazer-007 Blazer-007 changed the title [GOBBLIN-XXX] Implement ActivityTimeoutStrategy for Temporal Activities [GOBBLIN-2190] Implement ActivityTimeoutStrategy for Temporal Activities Jan 23, 2025
@Blazer-007 Blazer-007 marked this pull request as ready for review January 23, 2025 12:34
@Blazer-007 Blazer-007 changed the title [GOBBLIN-2190] Implement ActivityTimeoutStrategy for Temporal Activities [GOBBLIN-2190] Implement ActivityConfigurationStrategy for Temporal Activities Jan 31, 2025

@Override
protected Promise<Integer> launchAsyncActivity(final WorkUnitClaimCheck wu) {
return Async.function(activityStub::processWorkUnit, wu);
protected Promise<Integer> launchAsyncActivity(final WorkUnitClaimCheck wu, final Properties props) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we plan to add unit tests for this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Unit tests for older temporal classes needs to be done separately as it will required dedicated effort for this which is beyond the scope of this PR

@vsinghal85
Copy link
Contributor

As discussed offline, please add the testing details

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 38.75%. Comparing base (a0cef28) to head (ab3789a).
Report is 2 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (a0cef28) and HEAD (ab3789a). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (a0cef28) HEAD (ab3789a)
3 1
Additional details and impacted files
@@              Coverage Diff              @@
##             master    #4093       +/-   ##
=============================================
- Coverage     49.03%   38.75%   -10.29%     
+ Complexity    10008     1599     -8409     
=============================================
  Files          1895      388     -1507     
  Lines         73612    16016    -57596     
  Branches       8188     1588     -6600     
=============================================
- Hits          36097     6207    -29890     
+ Misses        34280     9311    -24969     
+ Partials       3235      498     -2737     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Blazer-007 Blazer-007 requested a review from Copilot February 6, 2025 07:11
Copy link

@Copilot 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 reviewed 5 out of 19 changed files in this pull request and generated 1 comment.

Files not reviewed (14)
  • gobblin-temporal/src/main/java/org/apache/gobblin/temporal/ddm/workflow/impl/ProcessWorkUnitsWorkflowImpl.java: Evaluated as low risk
  • gobblin-temporal/src/main/java/org/apache/gobblin/temporal/ddm/workflow/impl/ExecuteGobblinWorkflowImpl.java: Evaluated as low risk
  • gobblin-temporal/src/main/java/org/apache/gobblin/temporal/ddm/launcher/ProcessWorkUnitsJobLauncher.java: Evaluated as low risk
  • gobblin-temporal/src/main/java/org/apache/gobblin/temporal/ddm/workflow/impl/NestingExecOfProcessWorkUnitWorkflowImpl.java: Evaluated as low risk
  • gobblin-temporal/src/main/java/org/apache/gobblin/temporal/ddm/work/WUProcessingSpec.java: Evaluated as low risk
  • gobblin-temporal/src/main/java/org/apache/gobblin/temporal/ddm/workflow/impl/CommitStepWorkflowImpl.java: Evaluated as low risk
  • gobblin-temporal/src/main/java/org/apache/gobblin/temporal/ddm/workflow/CommitStepWorkflow.java: Evaluated as low risk
  • gobblin-temporal/src/main/java/org/apache/gobblin/temporal/util/nesting/workflow/NestingExecWorkflow.java: Evaluated as low risk
  • gobblin-temporal/src/main/java/org/apache/gobblin/temporal/util/nesting/workflow/AbstractNestingExecWorkflowImpl.java: Evaluated as low risk
  • gobblin-temporal/src/main/java/org/apache/gobblin/temporal/ddm/workflow/ProcessWorkUnitsWorkflow.java: Evaluated as low risk
  • gobblin-temporal/src/main/java/org/apache/gobblin/temporal/loadgen/workflow/impl/NestingExecOfIllustrationItemActivityWorkflowImpl.java: Evaluated as low risk
  • gobblin-temporal/src/main/java/org/apache/gobblin/temporal/loadgen/launcher/GenArbitraryLoadJobLauncher.java: Evaluated as low risk
  • gobblin-temporal/src/main/java/org/apache/gobblin/temporal/GobblinTemporalConfigurationKeys.java: Evaluated as low risk
  • gobblin-temporal/src/main/java/org/apache/gobblin/temporal/ddm/activity/ActivityConfigurationStrategy.java: Evaluated as low risk
Comments suppressed due to low confidence (3)

gobblin-temporal/src/test/java/org/apache/gobblin/temporal/ddm/util/TemporalActivityUtilsTest.java:39

  • Mocking ActivityType is unnecessary and might lead to misleading test results. Use a real ActivityType value instead.
ActivityType activityType = Mockito.mock(ActivityType.class);

gobblin-temporal/src/main/java/org/apache/gobblin/temporal/ddm/util/TemporalActivityUtils.java:49

  • Add validation to ensure that every ActivityType has a corresponding strategy to prevent runtime errors.
private static final Map<ActivityType, ActivityConfigurationStrategy> activityConfigurationStrategies = new HashMap<>();

gobblin-temporal/src/main/java/org/apache/gobblin/temporal/ddm/util/TemporalActivityUtils.java:29

  • Correct the spelling of 'Temporal' in the comment on line 30.
import lombok.experimental.UtilityClass;

Comment on lines 34 to 38
int DEFAULT_GENERATE_WORKUNITS_ACTIVITY_STARTTOCLOSE_TIMEOUT_MINUTES = 120;
int DEFAULT_RECOMMEND_SCALING_ACTIVITY_STARTTOCLOSE_TIMEOUT_MINUTES = 5;
int DEFAULT_DELETE_WORK_DIRS_ACTIVITY_STARTTOCLOSE_TIMEOUT_MINUTES = 10;
int DEFAULT_PROCESS_WORKUNIT_ACTIVITY_STARTTOCLOSE_TIMEOUT_MINUTES = 180;
int DEFAULT_COMMIT_ACTIVITY_STARTTOCLOSE_TIMEOUT_MINUTES = 180;
Copy link
Contributor

Choose a reason for hiding this comment

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

let's update the default numbers to a higher value for now till we have better visibility and tuning in place. Also, we already see flows which are running close to these number and timing out those isn't correct eg. GENERATE_WORKUNITS=4h, PROCESS_WORKUNIT=6h, COMMIT=4h

do we know how much max time max takes/can take and what is the factor that increases the time, if no, let's also increase DELETE_WORK_DIRS/ RECOMMEND_SCALING time

Copy link
Member Author

Choose a reason for hiding this comment

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

I have updated to use a single DEFAULT time for all activity type to simplify the code

public interface ActivityConfigurationStrategy {
/** Default start to close timeout duration for any activity if not specified. */
Duration defaultStartToCloseTimeout = Duration.ofMinutes(180);
int DEFAULT_GENERATE_WORKUNITS_ACTIVITY_STARTTOCLOSE_TIMEOUT_MINUTES = 120;
Copy link
Contributor

Choose a reason for hiding this comment

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

do we have numbers currently, how long can it take for each activity, ideally we want this number to be higher than 100th %ile of all executions that are running and also having scope for what we support(max data copy size - something that we will have as part of our SLAs for users)

Copy link
Member Author

Choose a reason for hiding this comment

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

Used 360 as default timeout for all activity

@Blazer-007 Blazer-007 changed the title [GOBBLIN-2190] Implement ActivityConfigurationStrategy for Temporal Activities [GOBBLIN-2190] Implement ActivityType & add HeartBeat for Temporal Activities Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants