Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #476] Biz Exceptions occured in EventMesh cause connection close of client #477

Merged
merged 20 commits into from
Aug 2, 2021
Merged

Conversation

lrhkobe
Copy link
Contributor

@lrhkobe lrhkobe commented Jul 29, 2021

Fixes ISSUE #476

Motivation

When the biz exception occured in EventMesh, such as, if throwing the ThreadPoolRejectException in the code of
eventMeshTCPServer.getTaskHandleExecutorService().submit(task) , it will cause the connection close of client. This looks obviously unreasonable.

Modifications

Catch the biz exception of EventMesh, and send the exception msg to client, not close the connection of client

lrhkobe added 19 commits May 15, 2021 21:39
…develop

� Conflicts:
�	eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/consumer/EventMeshConsumer.java
�	eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/tcp/client/group/ClientGroupWrapper.java
�	eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/tcp/client/session/Session.java
�	eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/tcp/client/task/MessageTransferTask.java
@codecov-commenter
Copy link

codecov-commenter commented Jul 29, 2021

Codecov Report

Merging #477 (bab7c3c) into develop (509104b) will increase coverage by 1.36%.
The diff coverage is 0.00%.

❗ Current head bab7c3c differs from pull request most recent head 5e3f88f. Consider uploading reports for the commit 5e3f88f to get more accurate results
Impacted file tree graph

@@              Coverage Diff              @@
##             develop     #477      +/-   ##
=============================================
+ Coverage       9.87%   11.23%   +1.36%     
- Complexity       283      326      +43     
=============================================
  Files            228      228              
  Lines          10798    10816      +18     
  Branches         907      907              
=============================================
+ Hits            1066     1215     +149     
+ Misses          9635     9504     -131     
  Partials          97       97              
Impacted Files Coverage Δ
...runtime/core/protocol/http/async/AsyncContext.java 0.00% <0.00%> (ø)
...ocol/tcp/client/EventMeshTcpMessageDispatcher.java 0.00% <0.00%> (ø)
...h/common/protocol/http/common/ProtocolVersion.java 45.00% <0.00%> (+10.00%) ⬆️
...http/header/message/PushMessageResponseHeader.java 60.29% <0.00%> (+60.29%) ⬆️
...ttp/header/message/ReplyMessageResponseHeader.java 65.78% <0.00%> (+65.78%) ⬆️
.../http/header/message/PushMessageRequestHeader.java 66.00% <0.00%> (+66.00%) ⬆️
...http/header/message/ReplyMessageRequestHeader.java 66.66% <0.00%> (+66.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 509104b...5e3f88f. Read the comment docs.

@@ -77,8 +76,45 @@ protected void channelRead0(ChannelHandlerContext ctx, Package pkg) throws Excep
dispatch(ctx, pkg, startTime, cmd);
} catch (Exception e) {
logger.error("exception occurred while pkg|cmd={}|pkg={}|errMsg={}", cmd, pkg, e);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The errMsg={} in the error log is redundant. It is better midify to

logger.error("exception occurred while pkg|cmd={}|pkg={}", cmd, pkg, e);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, I got it, and I will fix it later.

@xwm1992 xwm1992 merged commit 05e3421 into apache:develop Aug 2, 2021
xwm1992 pushed a commit to xwm1992/EventMesh that referenced this pull request Dec 27, 2021
…on close of client (apache#477)

* modify:optimize flow control in downstreaming msg

* modify:optimize stategy of selecting session in downstream msg

* modify:optimize msg downstream,msg store in session

* modify:fix bug:not a @sharable handler

* modify:downstream broadcast msg asynchronously

* modify:remove unneccessary interface in eventmesh-connector-api

* modify:fix conflict

* modify:add license in EventMeshAction

* modify:fix ack problem

* modify:fix exception handle when exception occured in EventMeshTcpMessageDispatcher

* modify:fix log print

close apache#476
xwm1992 pushed a commit that referenced this pull request Aug 4, 2022
…se of client (#477)

* modify:optimize flow control in downstreaming msg

* modify:optimize stategy of selecting session in downstream msg

* modify:optimize msg downstream,msg store in session

* modify:fix bug:not a @sharable handler

* modify:downstream broadcast msg asynchronously

* modify:remove unneccessary interface in eventmesh-connector-api

* modify:fix conflict

* modify:add license in EventMeshAction

* modify:fix ack problem

* modify:fix exception handle when exception occured in EventMeshTcpMessageDispatcher

* modify:fix log print

close #476
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants