-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Handle comment notification transactionally and asynchronously #1916
Handle comment notification transactionally and asynchronously #1916
Conversation
Comment events handlers are executed asynchronously. And default transaction isolation is read_committed, so the handlers can not see the comments created by event dispatcher Signed-off-by: johnniang <johnniang@fastmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/cherrypick release-1.5 |
@JohnNiang: once the present PR merges, I will cherry-pick it on top of release-1.5 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
src/main/java/run/halo/app/listener/comment/CommentEventListener.java
Outdated
Show resolved
Hide resolved
Signed-off-by: johnniang <johnniang@fastmail.com>
/hold I'll test if that method is executed asynchronously. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/ping @halo-dev/sig-halo |
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ruibaby The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@JohnNiang: new pull request created: #1935 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What this PR does
Set transaction isolation to read_uncommitted because the comment event handlers are executed asynchronously.
Why we need it?
Comment events handlers are executed asynchronously.
And default transaction isolation is read_committed,
so the handlers can not see the comments created by event dispatcher
Which issue this PR fixes
Fix #1798
Fix #1789
References
/kind bug
/area core
/milestone 1.5.x