NullPointerException followed by build hanging

We are intermittently getting this NPE followed by the build hanging (in our large, multi-module build running with parallel, daemon and configuration-on-demand):

java.lang.NullPointerException
    at 
org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:73)
    at com.sun.proxy.$Proxy0.onOutput(Unknown Source)
    at 
org.gradle.logging.internal.OutputEventRenderer.onOutput(OutputEventRenderer.java:247)
    at 
org.gradle.logging.internal.logback.LogbackLoggingConfigurer$GradleAppender.append(LogbackLoggingConfigurer.java:132)
    at 
org.gradle.logging.internal.logback.LogbackLoggingConfigurer$GradleAppender.append(LogbackLoggingConfigurer.java:124)
    at ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:85)
    at 
ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:48)
    at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:272)
    at ch.qos.logback.classic.Logger.callAppenders(Logger.java:259)
    at 
ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:441)
    at 
ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:395)
    at ch.qos.logback.classic.Logger.error(Logger.java:558)
    at 
org.gradle.messaging.remote.internal.hub.MessageHubBackedObjectConnection$1.execute(MessageHubBackedObjectConnection.java:48)
    at 
org.gradle.messaging.remote.internal.hub.MessageHubBackedObjectConnection$1.execute(MessageHubBackedObjectConnection.java:46)
    at 
org.gradle.messaging.remote.internal.hub.MessageHub$ConnectionDispatch.run(MessageHub.java:300)
    at 
org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
    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)

This happens in Gradle 2.3:

gradle --version


Gradle 2.3

Build time: 2015-02-16 05:09:33 UTC
Build number: none
Revision: 586be72bf6e3df1ee7676d1f2a3afd9157341274

Groovy: 2.3.9
Ant: Apache Antâ„¢ version 1.9.3 compiled on December 23 2013
JVM: 1.8.0_40-ea (Oracle Corporation 25.40-b23)
OS: Linux 3.13.0-48-generic amd64

Related: Another NPE/build hang