Claus Ibsen created CAMEL-25004:
-----------------------------------

             Summary: camel-core - Producer cache and stream caching: fix 
lifecycle bugs found in a deep review
                 Key: CAMEL-25004
                 URL: https://issues.apache.org/jira/browse/CAMEL-25004
             Project: Camel
          Issue Type: Bug
          Components: camel-core
            Reporter: Claus Ibsen


A review of the producer cache and the stream caching strategy found the bugs 
below. Each one was reproduced against 4.23.0-SNAPSHOT.

# *Evicting the producer of an endpoint in use stops the endpoint.* When the 
producer of a singleton endpoint was evicted from a producer cache (such as the 
cache of toD, with a small cacheSize), the service pool stopped the endpoint as 
well (since CAMEL-14594), also when the routes were using it, such as an 
endpoint a route consumes from. The endpoint was started again on next use, but 
was stopped in between. The endpoint is now only stopped when it is not in use 
by the routes (a dynamic endpoint, such as from toD, that no route consumes 
from), so dynamic endpoints still free their resources.
# *The stream caching strategy accumulates its configuration when started 
again.* Each start added the spool rules of the spool thresholds, the classes 
of allowClasses/denyClasses given by name, and the core type converters again. 
They are now not duplicated.
# *allowClasses/denyClasses given both as classes and as names fail.* 
setAllowClasses(Class...) stores an immutable list, and the classes given by 
name were added to it, which failed with UnsupportedOperationException when 
starting.
# *The spool directory is not removed when spooling only by used heap memory.* 
The spool directory was only removed when stopping if spoolThreshold > 0. When 
spooling was only by spoolUsedHeapMemoryThreshold (or custom spool rules), the 
spool directory was left behind. It is now removed whenever spooling to disk 
was in use.

_Claude Code on behalf of Claus Ibsen_




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to