Skip to content

Commit

Permalink
fix: causing API to be pending when plugin startup encounters an error (
Browse files Browse the repository at this point in the history
#6207)

#### What type of PR is this?
/kind improvement
/area core
/area plugin

#### What this PR does / why we need it:
修复当启动插件遇到 Error 级别的错误时会导致 API 被挂起无法终止的问题

```
- Throwable
    - Error
    - Exception
```
see #6192 for more details

#### Which issue(s) this PR fixes:
Fixes #6192

#### Does this PR introduce a user-facing change?
```release-note
修复当启动插件遇到 Error 级别的错误时会导致 API 被挂起无法终止的问题
```
  • Loading branch information
guqing authored Jun 29, 2024
1 parent c1ca8d1 commit 8e97814
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public Result reconcile(Request request) {
}
}
return result;
} catch (Exception e) {
} catch (Throwable e) {
status.getConditions().addAndEvictFIFO(Condition.builder()
.type(ConditionType.READY)
.status(ConditionStatus.FALSE)
Expand Down Expand Up @@ -313,7 +313,7 @@ private Result enablePlugin(Plugin plugin) {
Failed to start plugin %s(%s).\
""".formatted(pluginName, pluginState));
}
} catch (Exception e) {
} catch (Throwable e) {
conditions.addAndEvictFIFO(Condition.builder()
.type(ConditionType.READY)
.status(ConditionStatus.FALSE)
Expand Down Expand Up @@ -365,7 +365,7 @@ private Result disablePlugin(Plugin plugin) {
}
try {
pluginManager.disablePlugin(pluginName);
} catch (Exception e) {
} catch (Throwable e) {
conditions.addAndEvictFIFO(Condition.builder()
.type(ConditionType.READY)
.status(ConditionStatus.FALSE)
Expand Down

0 comments on commit 8e97814

Please sign in to comment.