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

Jenkins Gearman Plugin causes NullPointerException and infinite loop. #5

Open
moberacker opened this issue Aug 11, 2015 · 0 comments
Open

Comments

@moberacker
Copy link

Setup:
java 1.8.0_51
Jenkins Gearman Plugin version => 0.1.2
Jenkins ver. 1.623
gearman server gearman-server-0.8.11-20150731.182506-1 (with cluster configuration)

The Jenkins Gearman Plugin installed on Jenkins fails with NullPointerException, which seems to cause the infinite loop, with information as below:

09:46:23.235 - [nioEventLoopGroup-3-2] DEBUG n.j.gearman.server.net.PacketHandler - Creating new handler!
09:46:23.235 - [nioEventLoopGroup-3-2] DEBUG n.j.gearman.server.net.PacketHandler - Client closed channel: [id: 0x21448de3, /127.0.0.1:50369 :> 0.0.0.0/0.0.0.0:4740]
09:46:23.235 - [nioEventLoopGroup-3-3] DEBUG n.j.gearman.server.net.PacketHandler - Creating new handler!
09:46:23.235 - [nioEventLoopGroup-3-4] DEBUG n.j.gearman.server.net.PacketHandler - Creating new handler!
09:46:23.235 - [nioEventLoopGroup-3-3] DEBUG n.j.gearman.server.net.Decoder - ---> SET_CLIENT_ID
09:46:23.235 - [nioEventLoopGroup-3-3] DEBUG n.j.gearman.server.net.PacketHandler -  ---> SET_CLIENT_ID
09:46:23.235 - [nioEventLoopGroup-3-3] DEBUG n.j.gearman.server.net.Decoder - ---> SET_CLIENT_ID
09:46:23.235 - [nioEventLoopGroup-3-3] DEBUG n.j.gearman.server.net.PacketHandler -  ---> SET_CLIENT_ID
09:46:23.235 - [nioEventLoopGroup-3-4] DEBUG n.j.gearman.server.net.Decoder - ---> SET_CLIENT_ID
09:46:23.235 - [nioEventLoopGroup-3-4] DEBUG n.j.gearman.server.net.PacketHandler -  ---> SET_CLIENT_ID
09:46:23.235 - [nioEventLoopGroup-3-3] DEBUG n.j.gearman.server.net.Decoder - ---> RESET_ABILITIES
09:46:23.235 - [nioEventLoopGroup-3-3] DEBUG n.j.gearman.server.net.PacketHandler -  ---> RESET_ABILITIES
09:46:23.235 - [nioEventLoopGroup-3-4] DEBUG n.j.gearman.server.net.Decoder - ---> SET_CLIENT_ID
09:46:23.235 - [nioEventLoopGroup-3-4] DEBUG n.j.gearman.server.net.PacketHandler -  ---> SET_CLIENT_ID
09:46:23.235 - [nioEventLoopGroup-3-4] DEBUG n.j.gearman.server.net.Decoder - ---> RESET_ABILITIES
09:46:23.235 - [nioEventLoopGroup-3-4] DEBUG n.j.gearman.server.net.PacketHandler -  ---> RESET_ABILITIES
09:46:23.235 - [nioEventLoopGroup-3-3] DEBUG n.j.gearman.server.net.Decoder - ---> CAN_DO
09:46:23.235 - [nioEventLoopGroup-3-3] DEBUG n.j.gearman.server.net.PacketHandler -  ---> CAN_DO
09:46:23.235 - [nioEventLoopGroup-3-4] DEBUG n.j.gearman.server.net.Decoder - ---> GRAB_JOB_UNIQ
09:46:23.235 - [nioEventLoopGroup-3-4] DEBUG n.j.gearman.server.net.PacketHandler -  ---> GRAB_JOB_UNIQ
09:46:23.235 - [nioEventLoopGroup-3-4] DEBUG n.j.gearman.server.net.Encoder - <--- NO_JOB
09:46:23.251 - [nioEventLoopGroup-3-3] WARN  n.j.gearman.server.net.PacketHandler - Unexpected exception from downstream.
java.lang.NullPointerException: null
    at net.johnewart.gearman.engine.core.JobManager.registerWorkerAbility(JobManager.java:81) ~[gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at net.johnewart.gearman.server.net.NetworkManager.registerAbility(NetworkManager.java:88) ~[gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at net.johnewart.gearman.server.net.PacketHandler.handlePacket(PacketHandler.java:100) ~[gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at net.johnewart.gearman.server.net.PacketHandler.channelRead0(PacketHandler.java:42) ~[gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) ~[gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:334) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:173) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:334) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:100) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:497) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:465) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:359) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at java.lang.Thread.run(Unknown Source) [na:1.8.0_51]
09:46:23.251 - [nioEventLoopGroup-3-4] DEBUG n.j.gearman.server.net.Decoder - ---> PRE_SLEEP
09:46:23.267 - [nioEventLoopGroup-3-4] DEBUG n.j.gearman.server.net.PacketHandler -  ---> PRE_SLEEP
09:46:23.267 - [nioEventLoopGroup-3-3] DEBUG n.j.gearman.server.net.PacketHandler - Client closed channel: [id: 0x2c94c700, /127.0.0.1:50384 :> 0.0.0.0/0.0.0.0:4740]
09:46:23.267 - [nioEventLoopGroup-3-3] WARN  n.j.gearman.server.net.PacketHandler - Unexpected exception from downstream.
java.lang.NullPointerException: null
    at net.johnewart.gearman.engine.core.JobManager.unregisterWorker(JobManager.java:98) ~[gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at net.johnewart.gearman.server.net.NetworkManager.channelDisconnected(NetworkManager.java:63) ~[gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at net.johnewart.gearman.server.net.PacketHandler.channelInactive(PacketHandler.java:58) ~[gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:234) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:220) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.handler.codec.ReplayingDecoder.channelInactive(ReplayingDecoder.java:346) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:234) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:220) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:767) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.AbstractChannel$AbstractUnsafe$5.run(AbstractChannel.java:558) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:366) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at java.lang.Thread.run(Unknown Source) [na:1.8.0_51]
09:46:23.267 - [nioEventLoopGroup-3-5] DEBUG n.j.gearman.server.net.PacketHandler - Creating new handler!
09:46:23.267 - [nioEventLoopGroup-3-5] DEBUG n.j.gearman.server.net.Decoder - ---> SET_CLIENT_ID
09:46:23.267 - [nioEventLoopGroup-3-5] DEBUG n.j.gearman.server.net.PacketHandler -  ---> SET_CLIENT_ID
09:46:23.267 - [nioEventLoopGroup-3-5] DEBUG n.j.gearman.server.net.Decoder - ---> RESET_ABILITIES
09:46:23.267 - [nioEventLoopGroup-3-5] DEBUG n.j.gearman.server.net.PacketHandler -  ---> RESET_ABILITIES
09:46:23.267 - [nioEventLoopGroup-3-5] DEBUG n.j.gearman.server.net.Decoder - ---> CAN_DO
09:46:23.267 - [nioEventLoopGroup-3-5] DEBUG n.j.gearman.server.net.PacketHandler -  ---> CAN_DO
09:46:23.267 - [nioEventLoopGroup-3-5] WARN  n.j.gearman.server.net.PacketHandler - Unexpected exception from downstream.
java.lang.NullPointerException: null
    at net.johnewart.gearman.engine.core.JobManager.registerWorkerAbility(JobManager.java:81) ~[gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at net.johnewart.gearman.server.net.NetworkManager.registerAbility(NetworkManager.java:88) ~[gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at net.johnewart.gearman.server.net.PacketHandler.handlePacket(PacketHandler.java:100) ~[gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at net.johnewart.gearman.server.net.PacketHandler.channelRead0(PacketHandler.java:42) ~[gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) ~[gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:334) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:173) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:334) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:100) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:497) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:465) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:359) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at java.lang.Thread.run(Unknown Source) [na:1.8.0_51]
09:46:23.282 - [nioEventLoopGroup-3-5] DEBUG n.j.gearman.server.net.PacketHandler - Client closed channel: [id: 0x3ccd1be1, /127.0.0.1:50405 :> 0.0.0.0/0.0.0.0:4740]
09:46:23.282 - [nioEventLoopGroup-3-5] WARN  n.j.gearman.server.net.PacketHandler - Unexpected exception from downstream.
java.lang.NullPointerException: null
    at net.johnewart.gearman.engine.core.JobManager.unregisterWorker(JobManager.java:98) ~[gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at net.johnewart.gearman.server.net.NetworkManager.channelDisconnected(NetworkManager.java:63) ~[gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at net.johnewart.gearman.server.net.PacketHandler.channelInactive(PacketHandler.java:58) ~[gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:234) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:220) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.handler.codec.ReplayingDecoder.channelInactive(ReplayingDecoder.java:346) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:234) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:220) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:767) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.AbstractChannel$AbstractUnsafe$5.run(AbstractChannel.java:558) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:366) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [gearman-server-0.8.11-20150731.182506-1.jar:0.4]
    at java.lang.Thread.run(Unknown Source) [na:1.8.0_51]

it seems to be a problem in JobManager.java method registerWorkerAbility(...) and method unregisterWorker(...) in combination with the cluster configuration...when commenting the lines

//metrics.handleWorkerAddition(worker);

and

//metrics.handleWorkerRemoval(worker);

solves the error but with the disadvantage that the web management console doesn't show the correct values or starting the gearman-server without cluster configuration.

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

1 participant