fix: causing API to be pending when plugin startup encounters an error (#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 被挂起无法终止的问题
```
pull/6220/head
guqing 2024-06-30 00:39:10 +08:00 committed by GitHub
parent c1ca8d14b7
commit 8e97814018
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -158,7 +158,7 @@ public class PluginReconciler implements Reconciler<Request> {
}
}
return result;
} catch (Exception e) {
} catch (Throwable e) {
status.getConditions().addAndEvictFIFO(Condition.builder()
.type(ConditionType.READY)
.status(ConditionStatus.FALSE)
@ -313,7 +313,7 @@ public class PluginReconciler implements Reconciler<Request> {
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)
@ -365,7 +365,7 @@ public class PluginReconciler implements Reconciler<Request> {
}
try {
pluginManager.disablePlugin(pluginName);
} catch (Exception e) {
} catch (Throwable e) {
conditions.addAndEvictFIFO(Condition.builder()
.type(ConditionType.READY)
.status(ConditionStatus.FALSE)