Skip to content

Commit

Permalink
fix enhance undertow runnable logic
Browse files Browse the repository at this point in the history
  • Loading branch information
yanhom1314 committed Sep 9, 2024
1 parent 566f728 commit 61f195a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ public EnhancedQueueExecutorProxy(final EnhancedQueueExecutor executor) {

@Override
public void execute(Runnable runnable) {
Runnable enhancedTask = EnhancedRunnable.of(getEnhancedTask(runnable), this);
AwareManager.execute(this, enhancedTask);
Runnable dtpRunnable = getEnhancedTask(runnable);
AwareManager.execute(this, dtpRunnable);
try {
super.execute(enhancedTask);
super.execute(EnhancedRunnable.of(dtpRunnable, this));
} catch (Throwable e) {
Throwable[] suppressedExceptions = e.getSuppressed();
for (Throwable t : suppressedExceptions) {
if (t instanceof RejectedExecutionException) {
AwareManager.beforeReject(enhancedTask, this);
AwareManager.beforeReject(dtpRunnable, this);
return;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void doEnhance(WebServer webServer) {
putAndFinalize(tpName, (ExecutorService) executor, new EnhancedQueueExecutorAdapter(proxy));
} catch (Throwable t) {
log.error("DynamicTp adapter, enhance {} failed, please adjust the order of the two dependencies" +
"(starter-undertow and starter-adapter-webserver) and try again.", tpName, t);
"(spring-boot-starter-undertow and starter-adapter-webserver) and try again.", tpName, t);
executors.put(tpName, new ExecutorWrapper(tpName, handler.adapt(executor)));
}
} else {
Expand Down

0 comments on commit 61f195a

Please sign in to comment.