[
https://issues.apache.org/jira/browse/CAMEL-22898?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18055463#comment-18055463
]
B.Schlops commented on CAMEL-22898:
-----------------------------------
>From what I can see this might be a general retry/startup handling issue in
>the PubSub consumer.
When the configured subscription does not exist, the subscriber startup fails
with a {{NotFoundException}} (e.g. {{{}NOT_FOUND: Subscription does not exist
...{}}}). However, it looks like Camel keeps trying to start the consumer in a
tight loop (no visible backoff), and memory usage continuously increases until
the JVM hits its limits.
I’m not 100% sure about the internal cause, but one possible explanation could
be that each failed start attempt creates a new Subscriber instance and retains
it (e.g. via an internal list), so the instances are not released/closed
properly on failure.
If that’s the case, it would be great to treat {{NotFoundException}} as a
non-recoverable configuration error (fail fast / stop consumer), or at least
introduce proper backoff and ensure resources are cleaned up on failed startup.
> Memory Leak in google PubSub consumer
> -------------------------------------
>
> Key: CAMEL-22898
> URL: https://issues.apache.org/jira/browse/CAMEL-22898
> Project: Camel
> Issue Type: Bug
> Components: camel-google-pubsub
> Affects Versions: 4.14.2
> Reporter: Sergei Skuratovich
> Priority: Major
> Fix For: 4.x
>
>
> When a subscription is no longer exists starting a subscriber throws an
> exception. That causes a continuous creation of a new subscriber and
> [addition|https://github.com/apache/camel/blob/64d58324797e9f43c86710bf10412d00b7af71da/components/camel-google/camel-google-pubsub/src/main/java/org/apache/camel/component/google/pubsub/GooglePubsubConsumer.java#L167]
> it to a subscriber list in a loop. The cоnsumed memory grows until it
> reaches its limits.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)