Skip to content

Require explicit registration of worker functions, fix CDK circular dependency error#352

Merged
twelch merged 13 commits intodevfrom
circular
Sep 20, 2024
Merged

Require explicit registration of worker functions, fix CDK circular dependency error#352
twelch merged 13 commits intodevfrom
circular

Conversation

@twelch
Copy link
Copy Markdown
Contributor

@twelch twelch commented Sep 17, 2024

💥This is a breaking change

Implements a new algorithm for assigning geoprocessing and preprocessing functions to nested LambdaStack's. It ensures that worker functions are kept in the same stack as their parent function, in order to avoid circular dependency errors where Lambda invoke permissions are created for lambda resources that are in different LambdaStacks and CDK can't figure out which stack should be created first.

A parent/worker relationship is now explicitly defined by the developer by passing a workers option to GeoprocessingHandler.
If a parent geoprocessing function called boundaryOverlap invokes a worker function called boundaryOverlapWorker then it should be registered as below.

export default new GeoprocessingHandler(kelpPersist, {
  title: "boundaryOverlap",
  description: "boundary overlap",
  executionMode: "async",
  workers: ['boundaryOverlapWorker']
});
  • Add workers option to GeoprocessingHandler
  • Error if worker used by two different parent functions
  • Error if worker is not registered with parent, and suspected it should be. e.g. boundaryOverlapWorker is likely a worker of boundaryOverlap

@twelch twelch marked this pull request as ready for review September 19, 2024 23:19
@twelch twelch changed the title Circular dependency error Fix CDK circular dependency error Sep 20, 2024
@twelch twelch changed the title Fix CDK circular dependency error 💥 Fix CDK circular dependency error Sep 20, 2024
@twelch twelch changed the title 💥 Fix CDK circular dependency error 💥 Add worker registration, fix CDK circular dependency error Sep 20, 2024
@twelch twelch changed the title 💥 Add worker registration, fix CDK circular dependency error 💥 Require explicit registration of worker functions, fix CDK circular dependency error Sep 20, 2024
@twelch twelch changed the title 💥 Require explicit registration of worker functions, fix CDK circular dependency error Require explicit registration of worker functions, fix CDK circular dependency error Sep 20, 2024
@twelch twelch merged commit 86ef9aa into dev Sep 20, 2024
@twelch twelch deleted the circular branch September 20, 2024 22:17
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.

1 participant