Skip to content

Commit

Permalink
Minor: more helpful warning when an observable is leaked.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Hearn committed Apr 11, 2017
1 parent 0c0c552 commit cf4363d
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand Down

0 comments on commit cf4363d

Please sign in to comment.