Giter VIP home page Giter VIP logo

Comments (2)

MEPalma avatar MEPalma commented on May 25, 2024

@attila thank you for taking the time to compile this thorough report. I was able to replicate the behaviour. We recently merged some changes that aim to address this issue. These changes are scheduled to be included in the next nightly release too. I would be grateful if you could test the new build at your earliest convenience and provide feedback on whether it resolves the problem you encountered. Thank you once again for bringing this issue forward.

from localstack.

attila avatar attila commented on May 25, 2024

@MEPalma thank you very much for looking into this.

I have tested the feature in the nightly build (2023-04-23) where I looked into the capability of creating state machines with the definition and also to verify that they work as intended. I achieved partial success in this, see details below.

I could create a state machine with the following definition:

{
  "StartAt": "MapState",
  "States": {
    "MapState": {
      "Type": "Map",
      "ItemsPath": "$.Items",
      "Iterator": {
        "StartAt": "Wait",
        "States": {
          "Wait": {
            "Type": "Wait",
            "Seconds": 5,
            "Next": "Proceed"
          },
          "Proceed": {
            "Type": "Pass",
            "End": true
          }
        }
      },
      "MaxConcurrencyPath": "$.MaxConcurrency",
      "End": true
    }
  }
}

Invoking the state machine with the following inputs verified that maximum concurrency was observed (by checking the "startDate" and "stopDate" of the executions)

{
  "MaxConcurrency": 5,
  "Items": [1,2,3,4,5,6,7,8,9,10]
}

However, when I specified the value of max concurrency as a string, the service did not cast it to a number like it does in the real AWS service, but failed with the following:

Exception=FailureEventException, Error=States.Runtime, Details={"executionFailedEventDetails": {"error": "States.Runtime", "cause": "The MaxConcurrencyPath field refers to value \"5\" which is not a valid integer: $.MaxConcurrency"}} at '(MaxConcurrencyPath| {'max_concurrency_value': 0, 'max_concurrency_path': '$.MaxConcurrency'}'

I think it's important to retain this capability because of a lack of string to number casting intrinsic functions available.

We do have a use case where the maximum concurrency would be set from a DynamoDB record attribute.
Example: given that DynamoDB returns these records as DynamoDB JSON, (i.e. { "max_concurrency": 5 } becomes { "max_concurrency": { "N": "5" }) and if I want to pick up the value as "MaxConcurrencyPath": "$.MyDynamoDBResult.Attributes.max_concurrency.N" it is impossible.

from localstack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.