You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "Krishna Mewara (Jira)" <ji...@apache.org> on 2026/02/28 11:20:00 UTC
[jira] [Resolved] (FINERACT-2449) Replace unbounded SimpleAsyncTaskExecutor with bounded ThreadPoolTaskExecutor
[ https://issues.apache.org/jira/browse/FINERACT-2449?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Krishna Mewara resolved FINERACT-2449.
--------------------------------------
Resolution: Fixed
> Replace unbounded SimpleAsyncTaskExecutor with bounded ThreadPoolTaskExecutor
> -----------------------------------------------------------------------------
>
> Key: FINERACT-2449
> URL: https://issues.apache.org/jira/browse/FINERACT-2449
> Project: Apache Fineract
> Issue Type: Improvement
> Components: Performance
> Affects Versions: 1.14.0
> Environment: Platform:
> OS: Linux / macOS / Windows (OS Agnostic)
> Java Version: 17+ (Standard Fineract Runtime)
> Framework: Spring Boot / Apache Fineract 1.x -> 1.14
> Infrastructure:
> Applicable to all deployment types (Local, Docker, Kubernetes).
> Target: High-concurrency environments requiring bounded resource usage.
> Reporter: Krishna Mewara
> Priority: Major
> Labels: improvement, performance, technical-debt, threading
>
> *Background* The current {{SimpleAsyncTaskExecutor}} creates a new thread for every task. While effective for light loads, this unbounded behavior poses a theoretical risk of thread exhaustion (OOM) under specific high-concurrency scenarios (as originally reported in FINERACT-1934).
> *Motivation for Change* Although the specific "thread explosion" from FINERACT-1934 is difficult to reproduce in standard local/CI environments, relying on an unbounded executor is contrary to Spring Boot best practices for production-grade financial systems.
> *Goal* Proactively replace the unbounded {{SimpleAsyncTaskExecutor}} with a bounded, configurable {{{}ThreadPoolTaskExecutor{}}}. This ensures deterministic resource usage and prevents any future possibility of thread leaks, regardless of load.
> *Proposed Solution*
> # Replace {{SimpleAsyncTaskExecutor}} with {{{}ThreadPoolTaskExecutor{}}}.
> # Configure safe defaults (Core: CPU{_}2, Max: CPU{_}5).
> # Implement robust unit tests (using {{CountDownLatch}} patterns) to scientifically prove that the new pool respects bounds while maintaining parallelism.
> # Ensure compatibility with all Fineract Modes (Read/Write/Batch).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)