You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Nikita Amelchev (Jira)" <ji...@apache.org> on 2023/04/12 14:28:00 UTC

[jira] [Updated] (IGNITE-18532) IndexOutOfBoundsException in KafkaToIgniteCdcStreamer

     [ https://issues.apache.org/jira/browse/IGNITE-18532?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nikita Amelchev updated IGNITE-18532:
-------------------------------------
    Labels: ise  (was: )

> IndexOutOfBoundsException in KafkaToIgniteCdcStreamer
> -----------------------------------------------------
>
>                 Key: IGNITE-18532
>                 URL: https://issues.apache.org/jira/browse/IGNITE-18532
>             Project: Ignite
>          Issue Type: Bug
>          Components: extensions
>    Affects Versions: 2.14
>            Reporter: Kishor Bachhav
>            Assignee: Maksim Timonin
>            Priority: Major
>              Labels: ise
>
> If the applier threads for some reason, then whiling joining the runner threads, join is waiting  for extra thread which actually does not exist.
> {code:java}
> class org.apache.ignite.IgniteException: Index 8 out of bounds for length 8
> 2	at org.apache.ignite.cdc.kafka.AbstractKafkaToIgniteCdcStreamer.run(AbstractKafkaToIgniteCdcStreamer.java:128)
> 3	at org.apache.ignite.cdc.kafka.KafkaToIgniteCdcStreamer.run(KafkaToIgniteCdcStreamer.java:71)
> 4	at org.apache.ignite.cdc.kafka.KafkaToIgniteCommandLineStartup.main(KafkaToIgniteCommandLineStartup.java:68)
> 5Caused by: java.lang.IndexOutOfBoundsException: Index 8 out of bounds for length 8
> 6	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
> 7	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
> 8	at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
> 9	at java.base/java.util.Objects.checkIndex(Objects.java:372)
> 10	at java.base/java.util.ArrayList.get(ArrayList.java:459)
> 11	at org.apache.ignite.cdc.kafka.AbstractKafkaToIgniteCdcStreamer.runAppliers(AbstractKafkaToIgniteCdcStreamer.java:184)
> 12	at org.apache.ignite.cdc.kafka.KafkaToIgniteCdcStreamer.runx(KafkaToIgniteCdcStreamer.java:110)
> 13	at org.apache.ignite.cdc.kafka.AbstractKafkaToIgniteCdcStreamer.run(AbstractKafkaToIgniteCdcStreamer.java:125)
> 14	... 2 more {code}
> Problematic code is
> {code:java}
> try { 
>       for (int i = 0; i < threadCnt + 1; i++) 
>           runners.get(i).join(); 
> }
> {code}
> runners is as array list of threads whose size is configured to specified number of threadCount.
> {{runners = new ArrayList<>(streamerCfg.getThreadCount());}}
> In our yaml {{threadCount: 8}}
> If this is the case, then in above code, while joining threads why are we iterating for 9 threads ({{{}threadCnt + 1{}}} = 8 +1)
> As a solution we need to iterate over runners with condition {{i < threadCnt}} and not {{i < threadCnt + 1}}



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