You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When exception occured in the method of channelRead0, it will be thrown, and handled by the method 'exceptionCaught' in the class of EventMeshTcpExceptionHandler .
When EventMesh caught the exception, it will send goodbye instruction to the client, that means the biz exception caused the connection close of client. It seems unreasonable.
public class EventMeshTcpExceptionHandler extends ChannelDuplexHandler {
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
Session session = eventMeshTCPServer.getClientSessionGroupMapping().getSession(ctx);
UserAgent client = session == null ? null : session.getClient();
logger.error("exceptionCaught, push goodbye to client|user={},errMsg={}", client, cause.fillInStackTrace());
String errMsg;
if (cause.toString().contains("value not one of declared Enum instance names")) {
errMsg = "Unknown Command type";
} else {
errMsg = cause.toString();
}
if (session != null) {
EventMeshTcp2Client.goodBye2Client(eventMeshTCPServer, session, errMsg, OPStatus.FAIL.getCode(), eventMeshTCPServer.getClientSessionGroupMapping());
} else {
EventMeshTcp2Client.goodBye2Client(ctx, errMsg, eventMeshTCPServer.getClientSessionGroupMapping(), eventMeshTCPServer.getEventMeshTcpMonitor());
}
}
}
The text was updated successfully, but these errors were encountered:
xwm1992
changed the title
Biz Exceptions occured in EventMesh cause connection close of client
[Bug] Biz Exceptions occured in EventMesh cause connection close of client
Dec 16, 2021
xwm1992
pushed a commit
to xwm1992/EventMesh
that referenced
this issue
Dec 27, 2021
Bug Report
Describe the bug
When exception occured in the method of
channelRead0
, it will be thrown, and handled by the method 'exceptionCaught' in the class ofEventMeshTcpExceptionHandler
.When EventMesh caught the exception, it will send goodbye instruction to the client, that means the biz exception caused the connection close of client. It seems unreasonable.
The text was updated successfully, but these errors were encountered: