[ROCKETMQ-166] onException callback may capture compressed message body#89
Closed
lizhanhui wants to merge 1 commit into
Closed
[ROCKETMQ-166] onException callback may capture compressed message body#89lizhanhui wants to merge 1 commit into
lizhanhui wants to merge 1 commit into
Conversation
2 similar comments
Contributor
Author
|
Comment to bump up this PR. |
Member
shroman
reviewed
Apr 17, 2017
shroman
left a comment
Contributor
There was a problem hiding this comment.
Looks good, but how about unit tests?
| msgBody = UtilAll.compress(msgBody, zipCompressLevel); | ||
| } catch (IOException e) { | ||
| requestHeader.setSysFlag(MessageSysFlag.clearCompressedFlag(sysFlag)); | ||
| log.error("tryToCompressMessage exception", e); |
Contributor
There was a problem hiding this comment.
What is the reason to have ERROR and WARN here?
Contributor
Author
There was a problem hiding this comment.
You mean why we log error on failing to compress message body?
Contributor
There was a problem hiding this comment.
I just wonder why both WARN and ERROR are needed.
Contributor
Author
There was a problem hiding this comment.
Got your point.
- The code is moved here, and same log level should be applied IMO. @vongosling @vintagewang any particular reason behind this?
Contributor
Author
|
@stevenschew Any idea? |
Member
|
@lizhanhui I will close the pr, if you happened to the same question, please let me know. |
pingww
pushed a commit
that referenced
this pull request
Aug 26, 2022
[ISSUE #22] Improving codeCov for mqtt.common
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If message body size exceeds specified threshold, client would try to compress the message body.
Here there are two issues: 1) current implementation changes message body directly, which is not a good practice; 2) if asynchronous send method is employed to deliver message, when onException is invoked, the callback may capture the compressed message body before the finally block restores it.