-
Notifications
You must be signed in to change notification settings - Fork 41
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
JenkinsPipeline triggering Two Builds in Jenkins #282
Comments
@disposab1e
|
I send it from one build.... I cannot send everything from the logs... I try to collect what might be useful. I you want I can grep for special infos. oc get bc schemas -o yaml apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
creationTimestamp: 2019-02-27T15:00:17Z
name: schemas
namespace: jenkins-ci
resourceVersion: "62112"
selfLink: /apis/build.openshift.io/v1/namespaces/jenkins-ci/buildconfigs/schemas
uid: 651ef08e-3aa0-11e9-9b7d-00505627371a
spec:
nodeSelector:
node-role.kubernetes.io/my-node: ci
output: {}
postCommit: {}
resources: {}
runPolicy: Serial
source:
git:
ref: master
uri: ssh://xxx@10.254.254.34/schemas.git
sourceSecret:
name: ssh-secret-bitbucket
type: Git
strategy:
jenkinsPipelineStrategy:
jenkinsfilePath: build/Buildfile
type: JenkinsPipeline
triggers:
- type: ConfigChange
status:
lastVersion: 1
oc get build schemas-1 -o yaml apiVersion: build.openshift.io/v1
kind: Build
metadata:
annotations:
openshift.io/build-config.name: schemas
openshift.io/build.number: "1"
openshift.io/jenkins-build-uri: http://jenkins-ci.cloudapps.example.com/job/-jenkins-ci-schemas/2/
openshift.io/jenkins-console-log-url: http://jenkins-ci.cloudapps.example.com/job/-jenkins-ci-schemas/2/console
openshift.io/jenkins-log-url: http://jenkins-ci.cloudapps.example.com/job/-jenkins-ci-schemas/2/consoleText
openshift.io/jenkins-status-json: '{ cannot send these details }'
creationTimestamp: 2019-02-27T15:00:17Z
labels:
buildconfig: schemas
openshift.io/build-config.name: schemas
openshift.io/build.start-policy: Serial
name: schemas-1
namespace: -jenkins-ci
ownerReferences:
- apiVersion: build.openshift.io/v1
controller: true
kind: BuildConfig
name: schemas
uid: 651ef08e-3aa0-11e9-9b7d-00505627371a
resourceVersion: "63347"
selfLink: /apis/build.openshift.io/v1/namespaces/-jenkins-ci/builds/schemas-1
uid: 652365f1-3aa0-11e9-9b7d-00505627371a
spec:
nodeSelector:
node-role.kubernetes.io/: ci
output: {}
postCommit: {}
resources: {}
serviceAccount: builder
source:
git:
ref: master
uri: ssh://xxx@10.254.254.34/schemas.git
sourceSecret:
name: -ssh-secret-bitbucket
type: Git
strategy:
jenkinsPipelineStrategy:
jenkinsfilePath: build/Buildfile
type: JenkinsPipeline
triggeredBy:
- message: Build configuration change
status:
completionTimestamp: 2019-02-27T15:08:29Z
config:
kind: BuildConfig
name: schemas
namespace: -jenkins-ci
output: {}
phase: Complete
startTimestamp: 2019-02-27T15:06:02Z
oc logs jenkins-1-pnjn8 INFO: Waiting for Pod to be scheduled (0/100): slave-oraclejdk-7dx5s TONS OF PREVIOUS MESSAGES Feb 27, 2019 3:01:37 PM org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud provision TONS OF PREVIOUS MESSAGES Feb 27, 2019 3:01:47 PM hudson.slaves.NodeProvisioner$2 run Feb 27, 2019 3:03:48 PM io.fabric8.jenkins.openshiftsync.CredentialsUtils upsertCredential TONS OF PREVIOUS MESSAGES Feb 27, 2019 3:05:10 PM io.fabric8.jenkins.openshiftsync.BuildSyncRunListener pollRun Feb 27, 2019 3:05:10 PM org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave _terminate Feb 27, 2019 3:05:11 PM okhttp3.internal.platform.Platform log TONS OF PREVIOUS MESSAGES Feb 27, 2019 3:06:02 PM org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave _terminate TONS OF PREVIOUS MESSAGES Feb 27, 2019 3:06:02 PM okhttp3.internal.platform.Platform log TONS OF PREVIOUS MESSAGES Feb 27, 2019 3:06:02 PM io.fabric8.jenkins.openshiftsync.BuildSyncRunListener onStarted Feb 27, 2019 3:06:05 PM io.fabric8.jenkins.openshiftsync.BuildSyncRunListener pollRun |
Perhaps something to do with: #284 ? |
hey @disposab1e I don't think this is directly related to whatever you are seeing with #284 (as I just noted there, I'm not seeing any problems with the folder disable/enable config field). That said, the log message That message shows up as a result of the sync plugin getting the build events before the build config events. We can't start builds until we know about the build configs. That logic gets called from a few spots and I suspect we have a concurrency issue. I think I can have a code change worked up pretty quickly, but reproducing the timing windows to cause the situation could be imprecise. Since you are able to see it so readily, would you be able to try a test version of the plugin that I could attach to this issue? thanks |
possibly avoids duplicate build entries in the skip list by indexing off of build name vs. obj synchronizes on the flush method since it possible can get called by multiple folks
Have PR #291 up sync-1.zip |
possibly avoids duplicate build entries in the skip list by indexing off of build name vs. obj synchronizes on the flush method since it possible can get called by multiple folks
I've initiated v1.0.34 of the plugin and it includes the fix noted above |
@gabemontero Sorry for late reaction! Was out for some days. I just updated my jenkins and give the new version a try. Will update this issue with my results soon. |
@gabemontero Looks good and it seems the concurrency issue is resolved so far. Great work! I will continue to have an eye on it and will inform you if something changes. Well done! |
Great thanks for the feedback @disposab1e. |
Jenkins: 2.138.1
Jenkins Sync Plugin: 1.0.31
OpenShift: 3.11.82
After installation of an JenkinsPipeline Build Config via APB in OpenShift 2 builds in Jenkins are triggered in 95%.
This was the same with OpenShift 3.9.40 and it never disappeared including the 1.0.30 release of this plugin.
In OpenShift only one Build is to see, but in Jenkins 95% of all cases 2 builds are triggered. It was a little bit better in 3.9.40 (approx. 60% of all cases.
I'm happy to help to gather more information when I know what information is needed.
The text was updated successfully, but these errors were encountered: