EOFException when terminating slaves programatically

50 views
Skip to first unread message

Carlos Sanchez

unread,
Aug 26, 2015, 10:30:18 AM8/26/15
to Jenkins Developers
Hi,

While writing the Kubernetes plugin, a plugin to dynamically start slaves in Kubernetes (something similar to the Docker one) I am getting EOFException when deleting the Pod (the container running the jenkins-slave jar)

The code for _terminate

            cloud.connect().deletePod(name, cloud.getNamespace());
            LOGGER.log(Level.INFO, "Terminated Kubernetes instance for slave {0}", name);
            toComputer().disconnect(OfflineCause.create(new Localizable(HOLDER, "offline")));
            LOGGER.log(Level.INFO, "Disconnected computer {0}", name);


I have tried in the reverse order, disconnect, then deletePod with the same result, even adding a sleep() call between both
I'm not sure what am I missing, if I should call something else to close the slave connection


Aug 26, 2015 4:19:17 PM org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave _terminate
INFO: Terminating Kubernetes instance for slave f911b094-2674-4645-b066-f28726e4b3d8
Aug 26, 2015 4:19:17 PM hudson.remoting.AbstractByteArrayCommandTransport$1 handle
WARNING: Failed to construct Command
java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2328)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2797)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:802)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:299)
at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:40)
at hudson.remoting.AbstractByteArrayCommandTransport$1.handle(AbstractByteArrayCommandTransport.java:61)
at org.jenkinsci.remoting.nio.NioChannelHub$2.run(NioChannelHub.java:594)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)


Thanks in advance

Jesse Glick

unread,
Aug 26, 2015, 1:15:55 PM8/26/15
to Jenkins Dev
On Wed, Aug 26, 2015 at 10:30 AM, Carlos Sanchez <car...@apache.org> wrote:
> I'm not sure what am I missing, if I should call something else to close the slave connection

Not sure, I also get a reproducible `EOFException` from `mock-slave`
tests. Kohsuke agreed something was wrong but the conversation stopped
there.
Reply all
Reply to author
Forward
0 new messages