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

Handle comment notification transactionally and asynchronously #1916

Merged
merged 2 commits into from
May 6, 2022

Conversation

JohnNiang
Copy link
Member

@JohnNiang JohnNiang commented May 5, 2022

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

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>
@f2c-ci-robot f2c-ci-robot bot added kind/bug Categorizes issue or PR as related to a bug. area/core Issues or PRs related to the Halo Core labels May 5, 2022
@f2c-ci-robot f2c-ci-robot bot added this to the 1.5.x milestone May 5, 2022
@f2c-ci-robot f2c-ci-robot bot requested review from lan-yonghui and ruibaby May 5, 2022 08:11
Copy link
Member

@ruibaby ruibaby left a comment

Choose a reason for hiding this comment

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

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label May 5, 2022
@JohnNiang
Copy link
Member Author

/cherrypick release-1.5

@halo-dev-bot
Copy link
Collaborator

@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:

/cherrypick release-1.5

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.

Signed-off-by: johnniang <johnniang@fastmail.com>
@f2c-ci-robot f2c-ci-robot bot removed the lgtm Indicates that a PR is ready to be merged. label May 6, 2022
@JohnNiang
Copy link
Member Author

/hold

I'll test if that method is executed asynchronously.

@f2c-ci-robot f2c-ci-robot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 6, 2022
@JohnNiang
Copy link
Member Author

That works very well. Please see the screenshot below:

image

/unhold

@f2c-ci-robot f2c-ci-robot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 6, 2022
Copy link
Member

@guqing guqing left a comment

Choose a reason for hiding this comment

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

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label May 6, 2022
@JohnNiang
Copy link
Member Author

/ping @halo-dev/sig-halo
/meow

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented May 6, 2022

@JohnNiang: cat image

In response to this:

/ping @halo-dev/sig-halo
/meow

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.

Copy link
Member

@ruibaby ruibaby left a comment

Choose a reason for hiding this comment

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

/approve

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented May 6, 2022

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 6, 2022
@f2c-ci-robot f2c-ci-robot bot merged commit 15d2f8e into halo-dev:master May 6, 2022
@halo-dev-bot
Copy link
Collaborator

@JohnNiang: new pull request created: #1935

In response to this:

/cherrypick release-1.5

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.

@JohnNiang JohnNiang changed the title Set transaction isolation to read_uncommitted due to @Async Handle comment notification transactional and asynchronously May 6, 2022
@JohnNiang JohnNiang changed the title Handle comment notification transactional and asynchronously Handle comment notification transactionally and asynchronously May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/core Issues or PRs related to the Halo Core kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

评论后发送邮件报错 评论在通过和回复时没有邮件通知
4 participants