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

Reloading the config triggers jobs multiple times per sqs message. #17

Open
edgarklerks opened this issue Mar 22, 2018 · 1 comment
Open

Comments

@edgarklerks
Copy link

We see that after a reload config, the sqs plugin triggers jobs multiple times. This causes builds to fail with the following error:

java.lang.Error: java.lang.IllegalStateException: JENKINS-23152: /var/lib/jenkins/jobs/nifi-sqs-trigger/builds/4561 already existed; will not overwrite with nifi-sqs-trigger #4561
After one reload, one extra trigger are generated. After two reloads, two extra triggers are generated. After three reloads, three extra triggers are generated. Etcetera.

I found the problem is not JENKINS-23152, that is merely protecting from overwriting builds.

Below is an example of the overtriggering of a job (after 3 reloads):

INFO: 000160 Received 1 message(s) from nifi-jenkins-queue (sqs.eu-west-1.amazonaws.com) {b4fc06d7-cec5-4252-b838-f0fe543b2fef}
Mar 22, 2018 11:20:04 AM io.relution.jenkins.awssqs.logging.Log write
INFO: 000160 Message received...
Mar 22, 2018 11:20:04 AM io.relution.jenkins.awssqs.logging.Log write
INFO: 000160 Triggering job with 4 parameters...
Mar 22, 2018 11:20:04 AM io.relution.jenkins.awssqs.logging.Log write
INFO: 000160 AWS SQS Message for nifi-sqs-trigger. Triggering #4562
Mar 22, 2018 11:20:04 AM io.relution.jenkins.awssqs.logging.Log write
INFO: 000160 Triggering job [COMPLETED]
Mar 22, 2018 11:20:04 AM io.relution.jenkins.awssqs.logging.Log write
INFO: 000160 Message received...
Mar 22, 2018 11:20:04 AM io.relution.jenkins.awssqs.logging.Log write
INFO: 000160 Triggering job with 4 parameters...
Mar 22, 2018 11:20:04 AM io.relution.jenkins.awssqs.logging.Log write
INFO: 000160 AWS SQS Message for nifi-sqs-trigger. Triggering #4562
Mar 22, 2018 11:20:04 AM io.relution.jenkins.awssqs.logging.Log write
INFO: 000160 Triggering job [COMPLETED]
Mar 22, 2018 11:20:04 AM io.relution.jenkins.awssqs.logging.Log write
INFO: 000160 Message received...
Mar 22, 2018 11:20:04 AM io.relution.jenkins.awssqs.logging.Log write
INFO: 000160 Triggering job with 4 parameters...
Mar 22, 2018 11:20:04 AM io.relution.jenkins.awssqs.logging.Log write
INFO: 000160 AWS SQS Message for nifi-sqs-trigger. Triggering #4562
Mar 22, 2018 11:20:04 AM io.relution.jenkins.awssqs.logging.Log write

After a restart the issue is gone.

How to reproduce

  1. Create a job, that reads out a sqs queue.
  2. Reload the config (through reload configuration from disk)
  3. Send a message to sqs
    (And then this process can be repeated to have more and more job triggers per message)

Versions

Jenkins: 2.89.3
Aws-SQS-Plugin ver: 2.0.1

@edgarklerks edgarklerks changed the title Reloading the config causes to trigger jobs multiple times per sqs message. Reloading the config triggers jobs multiple times per sqs message. Mar 22, 2018
@dshvedchenko
Copy link

Hello

Thank you for wonderful plugin !

Found, that event removing trigger from job config only removes one extra triggering, but job still continue to be executed by previously configured sqs

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

No branches or pull requests

2 participants