Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConcurrentModificationException when creating multiple glue triggers against a workflow at once #21759

Closed
moreandres opened this issue Nov 12, 2021 · 7 comments · Fixed by #34530
Assignees
Labels
bug Addresses a defect in current functionality. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/glue Issues and PRs that pertain to the glue service.
Milestone

Comments

@moreandres
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

$ terraform -v
Terraform v1.0.11
on linux_amd64

  • provider registry.terraform.io/hashicorp/aws v3.65.0

Affected Resource(s)

  • aws_glue_workflow
  • aws_glue_trigger
  • aws_glue_job

Terraform Configuration Files

provider "aws" {
  region = "us-east-1"
}

resource "aws_glue_workflow" "workflow" {
  name = "test"
}

resource "aws_glue_trigger" "start" {
  name          = "start"
  workflow_name = aws_glue_workflow.workflow.name
  type          = "ON_DEMAND"

  actions {
    job_name = "start"
  }
}

locals {
  names = ["1", "2", "3", "4", "5"]
}

resource "aws_glue_trigger" "trigger" {

  for_each      = toset(local.names)
  name          = each.key
  workflow_name = aws_glue_workflow.workflow.name
  type          = "CONDITIONAL"

  actions {
    job_name = each.key
  }

  predicate {
    conditions {
      job_name = "start"
      state    = "SUCCEEDED"
    }
  }
}

Debug Output

debugging output

Expected Behavior

Multiple triggers should have been created concurrently and associated with the workflow resource.

Actual Behavior

Error: error creating Glue Trigger (1): ConcurrentModificationException: Workflow test was modified while adding trigger 1 to it

Steps to Reproduce

  1. terraform apply -auto-approve

Important Factoids

Can be reproduced with jobs besides triggers.

References

exception documentation

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/glue Issues and PRs that pertain to the glue service. labels Nov 12, 2021
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Nov 12, 2021
@moreandres
Copy link
Author

Hi! I'm interested in solving this issue, any pointers on where to start? Thanks!

@caioz7
Copy link

caioz7 commented Feb 2, 2022

Same problem here

@stefan-novak-brt
Copy link

stefan-novak-brt commented Jun 7, 2022

Came across this issue as well. Are there any workarounds?

Edit:

The following is a workaround:

until terraform apply --auto-approve
do
  sleep 2
done

🙃

@rbatorowski-at-pgs
Copy link

rbatorowski-at-pgs commented Aug 16, 2022

As workaround, add depends_on to your triggers, so they'll be created one by one. Worked for me.

@stagha
Copy link

stagha commented May 4, 2023

Using depends_on doesn't work if you're creating triggers inside of a for_each. depends_on requires a static list of resources.

@jar-b jar-b self-assigned this Nov 22, 2023
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Nov 22, 2023
@github-actions github-actions bot added this to the v5.27.0 milestone Nov 22, 2023
@github-actions github-actions bot removed the bug Addresses a defect in current functionality. label Nov 27, 2023
Copy link

This functionality has been released in v5.27.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 28, 2023
@justinretzolk justinretzolk added the bug Addresses a defect in current functionality. label Feb 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/glue Issues and PRs that pertain to the glue service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants