[ 
https://issues.apache.org/jira/browse/CAMEL-27868?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18153221#comment-18153221
 ] 

Guillaume Nodet commented on CAMEL-27868:
-----------------------------------------

This issue is being investigated by a coding agent (on behalf of gnodet).

Two root causes confirmed in components/camel-dataset:
1. DataSetEndpoint.waitForCompleteLatch() (lines 148-160): the count variable 
is overwritten with the per-iteration delta (count = getReceivedCounter() - 
count) on each loop iteration. When the latch is already at 0, 
super.waitForCompleteLatch(1000L) returns immediately, so the loop busy-spins 
forever.
2. DataSetTestComponent.createEndpoint() (line 42): getAndRemoveParameter(..., 
Long.class) fails with NumberFormatException for duration strings like '2s' 
because the catalog declares timeout as javaType=java.time.Duration. Fix: 
remove the manual extraction and let setProperties() handle it via the 
generated configurer.

_Note: This comment was generated by an AI coding agent and requires manual 
verification._

> camel-dataset: minRate makes assertIsSatisfied loop forever, dataset-test 
> timeout fails with a duration value
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-27868
>                 URL: https://issues.apache.org/jira/browse/CAMEL-27868
>             Project: Camel
>          Issue Type: Bug
>            Reporter: Claus Ibsen
>            Assignee: Guillaume Nodet
>            Priority: Minor
>             Fix For: 4.25.0
>
>
> Found while improving the option descriptions of camel-dataset for 
> CAMEL-23832 (commit 
> https://github.com/apache/camel/commit/1aaff12f7925110d68d6576bdc6977b75773cc4a,
>  pull request https://github.com/apache/camel/pull/31146).
> These are separate problems of the component; the descriptions change only 
> documents the current behavior.
> h4. 1. minRate makes assertIsSatisfied loop forever
> In {{DataSetEndpoint.waitForCompleteLatch(long)}} with minRate > 0, count = 
> getReceivedCounter() - count overwrites the total with the delta, so the loop 
> never ends once it has looped once, and with the latch at 0 it busy-spins. 
> Reproduced: SimpleDataSet(2000), produceDelay=1, resultWaitTime=500, 
> minRate=10 was still waiting 20 s after all messages arrived.
> Proposed change: keep the previous total and the delta separately, and stop 
> when the latch is 0.
> h4. 2. dataset-test timeout fails with a duration
> {{DataSetTestComponent.createEndpoint}} reads timeout with 
> getAndRemoveParameter(..., Long.class); the catalog declares a Duration, and 
> timeout=2s fails with NumberFormatException (reproduced).
> Proposed change: let setProperties (the configurer) handle it.
> _Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to