mirror of https://github.com/apache/cloudstack.git
* Async event bus publishing in AsyncJobManagerImpl to reduce API thread contention publishOnEventBus() was calling _messageBus.publish() synchronously on the request thread, which blocks on MessageBusBase$Gate (an exclusive mutex). JFR analysis showed this causing up to 107ms waits on Jetty request threads, contributing to 502 errors from the upstream load balancer. Move event bus publishing to a dedicated single-threaded executor so API request threads are no longer blocked by Gate contention. Event ordering is preserved by the single-threaded executor. * Wrap async event bus publish in ManagedContextRunnable for DB connection safety The sole subscriber (ApiServer.handleAsyncJobPublishEvent) performs DAO reads (getUserIncludingRemoved, getAccount, findById) inside its callback. Without ManagedContextRunnable, the EventBus thread would not have proper TransactionLegacy lifecycle management, risking DB connection leaks. * logger fix * review comments * review changes --------- Co-authored-by: Aaron Chung <aaron_chung@apple.com> |
||
|---|---|---|
| .. | ||
| agent-lb | ||
| ca | ||
| cluster | ||
| config | ||
| db | ||
| direct-download | ||
| events | ||
| extensions | ||
| ipc | ||
| jobs | ||
| managed-context | ||
| quota | ||
| rest | ||
| security | ||
| spring | ||
| pom.xml | ||