From 14f3880f43dfc1747619c8b019d202a0248696a3 Mon Sep 17 00:00:00 2001 From: "igor.petrenko" Date: Wed, 8 Nov 2023 14:18:36 +0200 Subject: [PATCH] XFG-30: Xenoss DSP Platform: fix messages --- .../java/oap/message/MessageHttpHandler.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/oap-stdlib/src/main/java/oap/message/MessageHttpHandler.java b/oap-stdlib/src/main/java/oap/message/MessageHttpHandler.java index 98ab583c95..79c287e0ec 100644 --- a/oap-stdlib/src/main/java/oap/message/MessageHttpHandler.java +++ b/oap-stdlib/src/main/java/oap/message/MessageHttpHandler.java @@ -185,19 +185,20 @@ public void handleRequest( HttpServerExchange exchange ) throws Exception { log.trace( "handler {}...", listener.getId() ); status = listener.run( messageVersion, hostName, size, data, md5 ); log.trace( "handler {}... Done. Status {}", listener.getId(), status ); - - writeResponse( exchange, status, clientId, md5 ); - if( status == STATUS_OK ) { - hashes.add( messageType, clientId, md5 ); - Metrics.counter( "oap.server.messages", Tags.of( "type", String.valueOf( Byte.toUnsignedInt( messageType ) ), "status", messageStatusToString( status ) ) ).increment(); - } else { - log.trace( "[{}] WARN [{}/{}] buffer ({}, " + size + ") status == {}.)", - clientHostPort, hostName, clientId, md5, messageStatusToString( status ) ); - } } catch( Throwable e ) { log.error( "[" + clientHostPort + "] " + e.getMessage(), e ); Metrics.counter( "oap.server.messages", Tags.of( "type", messageTypeToString( messageType ), "status", messageStatusToString( STATUS_UNKNOWN_ERROR_NO_RETRY ) ) ).increment(); writeResponse( exchange, STATUS_UNKNOWN_ERROR_NO_RETRY, clientId, md5 ); + + return; + } + writeResponse( exchange, status, clientId, md5 ); + if( status == STATUS_OK ) { + hashes.add( messageType, clientId, md5 ); + Metrics.counter( "oap.server.messages", Tags.of( "type", String.valueOf( Byte.toUnsignedInt( messageType ) ), "status", messageStatusToString( status ) ) ).increment(); + } else { + log.trace( "[{}] WARN [{}/{}] buffer ({}, " + size + ") status == {}.)", + clientHostPort, hostName, clientId, md5, messageStatusToString( status ) ); } } } else {