elasticsearch/elasticsearch — pull request #6190 by martijnvg (2014-05-15 16:17:23+00:00)
Title: Cat recovery api can return NPE

The recovery type isn't serialized. This can cause a NPE like this:
```
Caused by: java.lang.NullPointerException
at org.elasticsearch.indices.recovery.RecoveryState.writeTo(RecoveryState.java:244)
at org.elasticsearch.action.admin.indices.recovery.ShardRecoveryResponse.writeTo(ShardRecoveryResponse.java:87)
at org.elasticsearch.transport.netty.NettyTransportChannel.sendResponse(NettyTransportChannel.java:83)
at org.elasticsearch.transport.netty.NettyTransportChannel.sendResponse(NettyTransportChannel.java:62)
at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$ShardTransportHandler.messageReceived(TransportBroadcastOperationAction.java:413)
at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$ShardTransportHandler.messageReceived(TransportBroadcastOperationAction.java:399)
at org.elasticsearch.transport.netty.MessageChannelHandler$RequestHandler.run(MessageChannelHandler.java:270)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
[2014-05-15 15:23:16,808][DEBUG][action.admin.indices.recovery] [listening-global1-1b] [sprinksights_p0_v2_20140423_0759][2], node[w6m6FIhsTd6Trs9WTM0okQ], [R], s[INITIALIZING]: Failed to execute [org.elasticsearch.action.admin.indices.recovery.RecoveryRequest@3c098485]
org.elasticsearch.transport.RemoteTransportException: [listening-global1-3b-3][inet[/10.0.2.91:9303]][indices/recovery/s]
Caused by: java.lang.NullPointerException
at org.elasticsearch.indices.recovery.RecoveryState.writeTo(RecoveryState.java:244)
at org.elasticsearch.action.admin.indices.recovery.ShardRecoveryResponse.writeTo(ShardRecoveryResponse.java:87)
at org.elasticsearch.transport.netty.NettyTransportChannel.sendResponse(NettyTransportChannel.java:83)
at org.elasticsearch.transport.netty.NettyTransportChannel.sendResponse(NettyTransportChannel.java:62)
at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$ShardTransportHandler.messageReceived(TransportBroadcastOperationAction.java:413)
at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$ShardTransportHandler.messageReceived(TransportBroadcastOperationAction.java:399)
at org.elasticsearch.transport.netty.MessageChannelHandler$RequestHandler.run(MessageChannelHandler.java:270)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
```