From 68a3cf84da13b6f97628c8a0cee86c3323c780ce Mon Sep 17 00:00:00 2001 From: kjaniak Date: Thu, 24 Jan 2019 07:29:50 +0100 Subject: Mitigation of unexpected hv-ves shutdown Change-Id: I96183e2358ac10457568d223f37d69c61dfd252d Issue-ID: DCAEGEN2-1117 Signed-off-by: kjaniak --- .../org/onap/dcae/collectors/veshv/impl/socket/NettyTcpServer.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sources/hv-collector-core/src/main/kotlin') diff --git a/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/socket/NettyTcpServer.kt b/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/socket/NettyTcpServer.kt index c76233f0..adc629bc 100644 --- a/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/socket/NettyTcpServer.kt +++ b/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/socket/NettyTcpServer.kt @@ -93,7 +93,12 @@ internal class NettyTcpServer(private val serverConfig: ServerConfiguration, } logger.debug(clientContext::fullMdc, Marker.Entry) { "Client connection request received" } - return collectorProvider(clientContext).fold( + messageHandlingStream(clientContext, nettyInbound).subscribe() + return nettyOutbound.neverComplete() + } + + private fun messageHandlingStream(clientContext: ClientContext, nettyInbound: NettyInbound): Mono = + collectorProvider(clientContext).fold( { logger.warn(clientContext::fullMdc) { "Collector not ready. Closing connection..." } Mono.empty() @@ -108,7 +113,6 @@ internal class NettyTcpServer(private val serverConfig: ServerConfiguration, it.handleConnection(createDataStream(nettyInbound)) } ) - } private fun populateClientContext(clientContext: ClientContext, connection: Connection) { clientContext.clientAddress = try { -- cgit 1.2.3-korg