Class FcThreadPools
java.lang.Object
org.frontcache.resilience.FcThreadPools
The named thread pools Frontcache owns, replacing
HystrixThreadPool.
Resilience4j ships a ThreadPoolBulkhead and it is deliberately not used here. It requires
queueCapacity >= 1, and Hystrix's maxQueueSize=-1 - what OriginPool runs with - means "no
queue", i.e. a SynchronousQueue that rejects rather than buffers. That difference is not cosmetic:
a queue in front of a slow origin converts fast rejection (and a fallback) into latency, which is
the opposite of what the isolation is for. Owning a plain ThreadPoolExecutor also means the
dashboard's thread-pool numbers can be read straight off it. See proposal section 5.2.
Pools are node-level resources, not per-domain ones: all() returns every pool with no
filtering, which is the fix for the thread-pool panel that has never rendered (section 6.6).-
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<String> all()Every pool, unfiltered.static ThreadPoolExecutorstatic ThreadPoolExecutorreapplyGeometry(FcResilienceConfig config) Re-applies pool geometry to the live pools from a freshly read config, in place.static longrejectionCount(String poolKey)
-
Method Details
-
pool
-
all
Every pool, unfiltered. The dashboard's thread-pool frames are emitted from this to every authorized subscriber: a thread pool belongs to the node, so there is no per-domain answer to give - which is precisely why the oldisOwnerGroupcomparison (the POOL NAME against the caller's domain) could never be true and the panel was always empty. -
existing
-
rejectionCount
-
reapplyGeometry
Re-applies pool geometry to the live pools from a freshly read config, in place.Three of the four numbers are mutable; the fourth is not
coreSize,maximumSizeandkeepAliveMinutesare settable on a runningThreadPoolExecutor.maxQueueSizeis not: it selects the queue TYPE at construction -< 1means aSynchronousQueuethat rejects rather than buffers - and an executor's queue cannot be replaced. Recreating the pool would abandon or kill in-flight origin calls, so a changedmaxQueueSizeis reported and not applied. Silently ignoring it is how an operator concludes the setting does nothing.- Returns:
- one human-readable warning per setting that could not be applied; empty when everything in the file is now live
-