Skip to content

Commit

Permalink
XFG-30: Xenoss DSP Platform: fix messages
Browse files Browse the repository at this point in the history
  • Loading branch information
galaxina committed Nov 8, 2023
1 parent 09dc05e commit 14f3880
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions oap-stdlib/src/main/java/oap/message/MessageHttpHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 14f3880

Please sign in to comment.