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 issue with repeatedly building plugin RouterFunction for CustomEndpoints #4890
Conversation
/cherry-pick release-2.10 |
@guqing: once the present PR merges, I will cherry-pick it on top of release-2.10 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. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #4890 +/- ##
============================================
- Coverage 56.88% 56.81% -0.08%
+ Complexity 2975 2971 -4
============================================
Files 514 515 +1
Lines 16912 16913 +1
Branches 1273 1273
============================================
- Hits 9621 9609 -12
- Misses 6750 6762 +12
- Partials 541 542 +1 ☔ View full report in Codecov by Sentry. |
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.
如果想要最小修改来修复这个问题,可以参考一下:cd8f1c2。
那么插件被停止后被缓存起来的已经生成的 router function如何移除呢🧐 |
你是对的。我确实忽略了这一点。 不过我更建议在构建 ApplicationContext 的时候注册 RouterFunction,而不是在插件启动时才异步注册。 |
那个改动不在此pr做,有计划在后续重构一下一些启动需要的步骤作为创建 context 的步骤,目前确实太分散了 |
application/src/main/java/run/halo/app/plugin/PluginCustomEndpointInitialization.java
Outdated
Show resolved
Hide resolved
application/src/main/java/run/halo/app/plugin/PluginApplicationInitializer.java
Outdated
Show resolved
Hide resolved
application/src/main/java/run/halo/app/plugin/PluginCustomEndpointBeanFactoryPostProcessor.java
Outdated
Show resolved
Hide resolved
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
/ping @halo-dev/sig-halo |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JohnNiang, 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 |
@guqing: new pull request created: #4908 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 type of PR is this?
/kind bug
/area core
/milestone 2.11.x
What this PR does / why we need it:
修复当使用 ab 压测插件提供的 CustomEndpoint 时会出现 OOM 的问题
see #4889 for more details.
how to test it?
-Xmx128m -Xms128m
JVM Option 指定 halo 的 heap space 为 128mimplements CustomEndpoint
提供的任意 API 是否会出现 OOM,例如:Which issue(s) this PR fixes:
Fixes #4889
Does this PR introduce a user-facing change?