Skip to content

[fix]: various concurrencyOperation bug fixes#247

Merged
zhongkechen merged 15 commits intomainfrom
concurrency
Mar 23, 2026
Merged

[fix]: various concurrencyOperation bug fixes#247
zhongkechen merged 15 commits intomainfrom
concurrency

Conversation

@zhongkechen
Copy link
Contributor

@zhongkechen zhongkechen commented Mar 23, 2026

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Issue Link, if available

Description

  • added missing ParallelBranchConfig and RunInChildContextConfig
  • move config classes into config package
  • renamed ParallelContext to ParallelDurableContext
  • split serialization from BaseDurableOperation into SerializableDurableOperation
  • moved thread context and thread deregistration from context class to runUserHandler
  • added a consumer thread to ConcurrencyOperation
  • moved proxy methods from Context impl class to context interface
  • unified completion config for map and parallel
  • removed unused NoopSerDes
  • add anyOf DurableFutures

Demo/Screenshots

Checklist

  • I have filled out every section of the PR template
  • I have thoroughly tested this change

Testing

Unit Tests

Have unit tests been written for these changes?

Integration Tests

Have integration tests been written for these changes?

Examples

Has a new example been added for the change? (if applicable)

@zhongkechen zhongkechen marked this pull request as ready for review March 23, 2026 02:30
@zhongkechen zhongkechen requested a review from a team March 23, 2026 02:30
@zhongkechen zhongkechen self-assigned this Mar 23, 2026
Comment on lines +271 to +273
if (toleratedFailureCount != null && failed > toleratedFailureCount) {
return ConcurrencyCompletionStatus.FAILURE_TOLERANCE_EXCEEDED;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

public static CompletionConfig allSuccessful() {
        }
        return new CompletionConfig(null, null, percentage);
    }

We have the above configuration for allSuccessful, does that mean if minSuccessful == null, we need to complete the concurrency opertion when there's any failure?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

allSuccessful is defined as

    public static CompletionConfig allSuccessful() {
        return new CompletionConfig(null, 0, null);
    }

There is no percentage parameter for allSuccessful, so where does it come from?

@zhongkechen zhongkechen merged commit 1284d48 into main Mar 23, 2026
12 of 14 checks passed
@zhongkechen zhongkechen deleted the concurrency branch March 23, 2026 16:47
@zhongkechen
Copy link
Contributor Author

This is a huge PR. I will merge the change now to avoid conflicts and unblock the others. Comments are still welcome, and I will follow up to resolve any potential issues.

@@ -31,15 +32,26 @@ public String handleRequest(GreetingRequest input, DurableContext context) {
context.wait(null, Duration.ofSeconds(10));
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 need to remove this? If we are waiting for 10 seconds within step 2.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

step2 is using wait as a at-most timer.


import java.util.concurrent.atomic.AtomicInteger;
import org.junit.jupiter.api.Test;
import software.amazon.lambda.durable.config.StepConfig;
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these placeholder for future changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

import wasn't needed because they were in the same package.

var root = DurableContextImpl.createRootContext(
executionManager, DurableConfig.builder().build(), null);
executionManager,
software.amazon.lambda.durable.DurableConfig.builder().build(),
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need full path?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think so. Added probably by IDE

@@ -1,6 +1,6 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we use common config for parallel and map both?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are different

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.

3 participants