changes to handle concurrency - cherry-picked

Copied from https://github.com/strands-project/strands_executive/pull/66 but just cherry-picked relevant changes as indicated by @BFALacerda. Bruno, please can you just sanity check this then I will merge it.