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

Fix the problem that publishing post always fails #3210

Merged
merged 2 commits into from
Feb 2, 2023

Conversation

JohnNiang
Copy link
Member

What type of PR is this?

/kind improvement
/area core
/milestone 2.3.x

What this PR does / why we need it:

  1. Refactor Queue in Controller. I add dirty set of request to avoid lost of new request from other places instead of reconciler.
  2. Enhance equals and hashcode methods to ensure we can ignore updates of same extensions.

Which issue(s) this PR fixes:

Fixes #2860

Special notes for your reviewer:

Please take some time to test publishing posts.

Does this PR introduce a user-facing change?

修复发布文章时经常出现错误的问题

@f2c-ci-robot f2c-ci-robot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/improvement Categorizes issue or PR as related to a improvement. labels Feb 2, 2023
@f2c-ci-robot f2c-ci-robot bot added this to the 2.3.x milestone Feb 2, 2023
@f2c-ci-robot f2c-ci-robot bot requested a review from guqing February 2, 2023 08:12
@f2c-ci-robot f2c-ci-robot bot added the area/core Issues or PRs related to the Halo Core label Feb 2, 2023
@f2c-ci-robot f2c-ci-robot bot requested a review from lan-yonghui February 2, 2023 08:12
@guqing
Copy link
Member

guqing commented Feb 2, 2023

Hi @minliacom, 有时间可以帮忙测试一下这个 PR 看发布文章失败的情况还会出现吗,我记得你之前经常遇到

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.

看起来工作良好,我试了 200 次。

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Feb 2, 2023
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.

/approve
我也没有复现出原来的问题 应该是可以了

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Feb 2, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: guqing

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 Feb 2, 2023
@f2c-ci-robot f2c-ci-robot bot merged commit 4636990 into halo-dev:main Feb 2, 2023
@JohnNiang JohnNiang deleted the refactor/controller-queue branch February 2, 2023 12:48
@JohnNiang JohnNiang modified the milestones: 2.3.x, 2.3.0 Feb 2, 2023
@guqing guqing mentioned this pull request Feb 3, 2023
f2c-ci-robot bot pushed a commit that referenced this pull request Feb 7, 2023
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
当开发模式启动时上传 JAR 运行插件会出现插件不存在的异常,但由于 PluginReconciler 中检查状态不一致后 return 在 optional 语句中只是让当前 optional 后面的代码停止执行,还会继续执行 optional 外面的代码导致 status 的异常信息不一致,进而 object equals 始终为 false 而无法让 reconciler 终止运行导致循环。

此 PR 调整了一下代码位置,进入 reconciler 时先进行检查,如果不满足则不执行后面的代码同时将信息写入 plugin.status 让用户知晓。

此问题是修改了 Reconciler 判断逻辑后出现的 #3210 ,因此不影响之前的代码只针对当前 2.3.x

#### Special notes for your reviewer:
how to test it?
1. 模拟一个插件找不到的错误场景例如以生产模式启动插件但配置 fixed-plugin 指定为插件项目目录
2. 启动 Halo 看 Reconciler 是否会一直在控制台输出日志
3. 卸载它能成功

/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
None
```
@ruibaby
Copy link
Member

ruibaby commented Feb 10, 2023

/cherry-pick release-2.2

@halo-dev-bot
Copy link
Collaborator

@ruibaby: new pull request created: #3276

In response to this:

/cherry-pick release-2.2

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.

f2c-ci-robot bot pushed a commit that referenced this pull request Feb 10, 2023
This is an automated cherry-pick of #3210

/assign ruibaby

```release-note
修复发布文章时经常出现错误的问题
```
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/improvement Categorizes issue or PR as related to a improvement. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

发布文章会经常出现发布失败
4 participants