Minor: more helpful warning when an observable is leaked.

This commit is contained in:
Mike Hearn 2017-04-11 14:37:08 +02:00
parent 0c0c5521c0
commit cf4363dc2e

View File

@ -389,9 +389,13 @@ class CordaRPCClientImpl(private val session: ClientSession,
false
}
if (closed) {
rpcLog.warn("A hot observable returned from an RPC ($rpcName) was never subscribed to. " +
"This wastes server-side resources because it was queueing observations for retrieval. " +
"It is being closed now, but please adjust your code to subscribe and unsubscribe from the observable to close it explicitly.", rpcLocation)
rpcLog.warn("""A hot observable returned from an RPC ($rpcName) was never subscribed to.
This wastes server-side resources because it was queueing observations for retrieval.
It is being closed now, but please adjust your code to call .notUsed() on the observable
to close it explicitly. (Java users: subscribe to it then unsubscribe). This warning
will appear less frequently in future versions of the platform and you can ignore it
if you want to.
""".trimIndent().replace('\n', ' '), rpcLocation)
}
}
}