question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple instances of step running at the same time

See original GitHub issue

I’m having an issue where multiple instances of the same step run “at the same time”.

I was wondering what are the chances of multiple instances of my application (running with load-balancer) hitting the database and getting the same RunnableInstances?

I looked into the code base and saw the function below, which seems to not work well with multiple instances, right?

private async process(self: PollWorker): Promise<void> {                
    self.logger.info("pollRunnables " + " - now = " + Date.now());
    //TODO: lock
    try {        
        let runnables = await self.persistence.getRunnableInstances();
        for (let item of runnables) {                    
            self.queueProvider.queueForProcessing(item, QueueType.Workflow);
        }
    }
    catch (err) {
        self.logger.error("Error running poll: " + err);
    }

    try {
        let events = await self.persistence.getRunnableEvents();
        for (let item of events) {
            self.queueProvider.queueForProcessing(item, QueueType.Event);
        }
    }
    catch (err) {
        self.logger.error("Error running poll: " + err);
    }
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
danielgerlagcommented, Mar 22, 2019

The persistence provider you choose has nothing to do with the concurrency providers you use. Currently, the only ones available are for Azure - https://github.com/danielgerlag/workflow-es/tree/master/providers/workflow-es-azure

I am working on a Redis implementation, should be ready in a week or two.

0reactions
danielgerlagcommented, May 12, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS Step Function: How can i invoke multiple instances of ...
The simplest solution is to make one more step called invoke10Lambdas and use it from your choice. Pseudo code for your step function...
Read more >
Executions in Step Functions
Each Step Functions state machine can have multiple simultaneous executions, which you can initiate from the Step Functions console , or by using...
Read more >
Concurrent execution of the same AWS Step Function
Let's say I want to use a Step Function to orchestrate a data workflow that starts with responding to a particular type of...
Read more >
Preventing Duplicate Executions in Step Function - YouTube
Sometime we might have a hard requirement to prevent executing this state machine twice with the same input.We can use the default feature ......
Read more >
AWS Step Functions: Parallelism and concurrency ... - YouTube
In this session, viewers learn to harness the power of parallelism to complete the same workload in less time. Three methods of serverless ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found