Merge branch 'release/os/4.6' into rfowler-os-4.6-ent-4.6-20200922

This commit is contained in:
Ryan Fowler
2020-09-22 11:42:00 +01:00
49 changed files with 1319 additions and 239 deletions

View File

@ -631,7 +631,9 @@ object InteractiveShell {
}
@JvmStatic
fun gracefulShutdown(userSessionOut: RenderPrintWriter, cordaRPCOps: CordaRPCOps) {
fun gracefulShutdown(userSessionOut: RenderPrintWriter, cordaRPCOps: CordaRPCOps): Int {
var result = 0 // assume it all went well
fun display(statements: RenderPrintWriter.() -> Unit) {
statements.invoke(userSessionOut)
@ -676,13 +678,16 @@ object InteractiveShell {
// Cancelled whilst draining flows. So let's carry on from here
cordaRPCOps.setFlowsDrainingModeEnabled(false)
display { println("...cancelled clean shutdown.") }
result = 1
}
} catch (e: Exception) {
display { println("RPC failed: ${e.rootCause}", Decoration.bold, Color.red) }
result = 1
} finally {
InputStreamSerializer.invokeContext = null
InputStreamDeserializer.closeAll()
}
return result;
}
private fun printAndFollowRPCResponse(