Comments (7)
Hi @spasche ,
can you help us investigate the issue by telling in which case you are falling:
https://github.com/openshift/jenkins-client-plugin/blob/master/src/main/java/com/openshift/jenkins/plugins/pipeline/OcWatch.java#L111
Based on what we have in the code, the return true is captured and normal exit code are also captured
?
from jenkins-client-plugin.
Hi @akram,
According to the logs, this path is taken: https://github.com/openshift/jenkins-client-plugin/blob/master/src/main/java/com/openshift/jenkins/plugins/pipeline/OcWatch.java#L127
Here are the logs with the testcase.
Pipeline] _OcContextInit
[Pipeline] readFile
[Pipeline] readFile
[Pipeline] _OcAction
[Pipeline] readFile
[Pipeline] _OcWatch
Entering watch
Running watch closure body
[Pipeline] {
[Pipeline] }
watch closure returned true; terminating watch
[Pipeline] // _OcWatch
[Pipeline] echo
List of processes
[Pipeline] sh
+ sleep 10
[Pipeline] sh
+ ps -efw
UID PID PPID C STIME TTY TIME CMD
1000700+ 1 0 0 16:38 ? 00:00:00 /usr/bin/coreutils --coreutils-prog-shebang=sleep /usr/bin/sleep 99d
1000700+ 7 0 0 16:39 pts/0 00:00:00 sh
1000700+ 37 0 0 16:39 ? 00:00:00 sh
1000700+ 43 37 3 16:39 ? 00:00:00 oc --server=https://kubernetes.default.svc.cluster.local --certificate-authority=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt --namespace=default --loglevel=0 --token=... get configmap/foo -w -o=name
1000700+ 70 1 0 16:39 ? 00:00:00 sh -c ({ while [ -d '/home/jenkins/agent/workspace/testcase@tmp/durable-3dff92c7' -a \! -f '/home/jenkins/agent/workspace/testcase@tmp/durable-3dff92c7/jenkins-result.txt' ]; do touch '/home/jenkins/agent/workspace/testcase@tmp/durable-3dff92c7/jenkins-log.txt'; sleep 3; done } & jsc=durable-092e8611f10f2111256b1d5babcb2670b22bcb4e427908c6dd8bb8566a9d64c0; JENKINS_SERVER_COOKIE=$jsc 'sh' -xe '/home/jenkins/agent/workspace/testcase@tmp/durable-3dff92c7/script.sh' > '/home/jenkins/agent/workspace/testcase@tmp/durable-3dff92c7/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/agent/workspace/testcase@tmp/durable-3dff92c7/jenkins-result.txt.tmp'; mv '/home/jenkins/agent/workspace/testcase@tmp/durable-3dff92c7/jenkins-result.txt.tmp' '/home/jenkins/agent/workspace/testcase@tmp/durable-3dff92c7/jenkins-result.txt'; wait) >&- 2>&- &
1000700+ 71 70 0 16:39 ? 00:00:00 sh -c ({ while [ -d '/home/jenkins/agent/workspace/testcase@tmp/durable-3dff92c7' -a \! -f '/home/jenkins/agent/workspace/testcase@tmp/durable-3dff92c7/jenkins-result.txt' ]; do touch '/home/jenkins/agent/workspace/testcase@tmp/durable-3dff92c7/jenkins-log.txt'; sleep 3; done } & jsc=durable-092e8611f10f2111256b1d5babcb2670b22bcb4e427908c6dd8bb8566a9d64c0; JENKINS_SERVER_COOKIE=$jsc 'sh' -xe '/home/jenkins/agent/workspace/testcase@tmp/durable-3dff92c7/script.sh' > '/home/jenkins/agent/workspace/testcase@tmp/durable-3dff92c7/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/agent/workspace/testcase@tmp/durable-3dff92c7/jenkins-result.txt.tmp'; mv '/home/jenkins/agent/workspace/testcase@tmp/durable-3dff92c7/jenkins-result.txt.tmp' '/home/jenkins/agent/workspace/testcase@tmp/durable-3dff92c7/jenkins-result.txt'; wait) >&- 2>&- &
1000700+ 83 71 0 16:39 ? 00:00:00 /usr/bin/coreutils --coreutils-prog-shebang=sleep /usr/bin/sleep 3
1000700+ 92 1 0 16:39 ? 00:00:00 sh -c ({ while [ -d '/home/jenkins/agent/workspace/testcase@tmp/durable-bb43849f' -a \! -f '/home/jenkins/agent/workspace/testcase@tmp/durable-bb43849f/jenkins-result.txt' ]; do touch '/home/jenkins/agent/workspace/testcase@tmp/durable-bb43849f/jenkins-log.txt'; sleep 3; done } & jsc=durable-092e8611f10f2111256b1d5babcb2670b22bcb4e427908c6dd8bb8566a9d64c0; JENKINS_SERVER_COOKIE=$jsc 'sh' -xe '/home/jenkins/agent/workspace/testcase@tmp/durable-bb43849f/script.sh' > '/home/jenkins/agent/workspace/testcase@tmp/durable-bb43849f/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/agent/workspace/testcase@tmp/durable-bb43849f/jenkins-result.txt.tmp'; mv '/home/jenkins/agent/workspace/testcase@tmp/durable-bb43849f/jenkins-result.txt.tmp' '/home/jenkins/agent/workspace/testcase@tmp/durable-bb43849f/jenkins-result.txt'; wait) >&- 2>&- &
1000700+ 93 92 0 16:39 ? 00:00:00 sh -c ({ while [ -d '/home/jenkins/agent/workspace/testcase@tmp/durable-bb43849f' -a \! -f '/home/jenkins/agent/workspace/testcase@tmp/durable-bb43849f/jenkins-result.txt' ]; do touch '/home/jenkins/agent/workspace/testcase@tmp/durable-bb43849f/jenkins-log.txt'; sleep 3; done } & jsc=durable-092e8611f10f2111256b1d5babcb2670b22bcb4e427908c6dd8bb8566a9d64c0; JENKINS_SERVER_COOKIE=$jsc 'sh' -xe '/home/jenkins/agent/workspace/testcase@tmp/durable-bb43849f/script.sh' > '/home/jenkins/agent/workspace/testcase@tmp/durable-bb43849f/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/agent/workspace/testcase@tmp/durable-bb43849f/jenkins-result.txt.tmp'; mv '/home/jenkins/agent/workspace/testcase@tmp/durable-bb43849f/jenkins-result.txt.tmp' '/home/jenkins/agent/workspace/testcase@tmp/durable-bb43849f/jenkins-result.txt'; wait) >&- 2>&- &
1000700+ 94 92 0 16:39 ? 00:00:00 sh -xe /home/jenkins/agent/workspace/testcase@tmp/durable-bb43849f/script.sh
1000700+ 96 94 0 16:39 ? 00:00:00 ps -efw
1000700+ 97 93 0 16:39 ? 00:00:00 /usr/bin/coreutils --coreutils-prog-shebang=sleep /usr/bin/sleep 3
[Pipeline] }
[Pipeline] // container
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // podTemplate
[Pipeline] End of Pipeline
Finished: SUCCESS
I can notice that the issue doesn't happen if I run the job directly on the master with this testcase:
openshift.withCluster() {
def cm = openshift.create('cm', 'foo')
cm.watch {
return true
}
echo "List of processes"
sh "sleep 10"
sh "ps -efw"
}
In this case, the process is properly terminated.
So the issue could be related to how the Kubernetes plugin launches processes.
I came across this issue on the Kubernetes plugin, which might be the cause: https://issues.jenkins.io/browse/JENKINS-58656
I tried the suggestion from https://gist.github.com/car-roll/4471dc9231abeb1db1271ad349706bcb (setting pod.spec.shareProcessNamespace to true) but that didn't help.
from jenkins-client-plugin.
@spasche reading the issue you are mentioning , it seems that issue should happen when the agent container does not use an init
process in the docker image.
On our side, we are using one for the parent base image of our agents.
You are using inline PodTemplate
declaration in your example and seem to be using direct the cli
image .
Can you try using instead our agent-base-image and setting the entrypoint agent to the go-init
binary that we embed there?
As you said, I think that for this one, we may depend on the kubernetes-plugin.
cc @gabemontero
from jenkins-client-plugin.
Issues go stale after 90d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen
.
If this issue is safe to close now please do so with /close
.
/lifecycle stale
from jenkins-client-plugin.
Stale issues rot after 30d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen
.
If this issue is safe to close now please do so with /close
.
/lifecycle rotten
/remove-lifecycle stale
from jenkins-client-plugin.
Rotten issues close after 30d of inactivity.
Reopen the issue by commenting /reopen
.
Mark the issue as fresh by commenting /remove-lifecycle rotten
.
Exclude this issue from closing again by commenting /lifecycle frozen
.
/close
from jenkins-client-plugin.
@openshift-bot: Closing this issue.
In response to this:
Rotten issues close after 30d of inactivity.
Reopen the issue by commenting
/reopen
.
Mark the issue as fresh by commenting/remove-lifecycle rotten
.
Exclude this issue from closing again by commenting/lifecycle frozen
./close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
from jenkins-client-plugin.
Related Issues (20)
- Question: What extra steps should i follow if my OCP4 cluster is using a proxy ? HOT 4
- exportable did not work on newer openshift clusters HOT 4
- Stream stdout to console for passthrough operations HOT 5
- Plugin incompatible with new-style clouds configuration. HOT 5
- Error after Warning HOT 7
- Can't get api token from com.openshift.jenkins.plugnis.OpenShiftTokenCredentials in pipeline HOT 5
- List of DSL methods required HOT 3
- Error to parse POM's HOT 4
- 'restart' subcommand is missing for rollout()
- Support current version of oc tool HOT 4
- Plugin installation broke credentials used by other plugins HOT 12
- Argument was classified as an image, image~source, or loaded template reference but should be git repo HOT 7
- Plugin doesn't detect capabilities (--ignore-not-found) from recent OC versions HOT 8
- No credentials shown in cluster configuration dropdown HOT 6
- Job fails if there are spaces in the project name, using raw command HOT 9
- Error flags cannot be placed before plugin name on external Jenkins declarative pipeline HOT 2
- Unable to retrieve object names using kubernetes-plugin sidecar container HOT 5
- java.nio.file.NoSuchFileException after upgrade to 1.0.37 HOT 5
- Certificate options not escaped HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jenkins-client-plugin.