Bug #4687
closedjava.lang.IndexOutOfBoundsException in ChronoSync2013
0%
Description
I ran into this exception while creating an Android application based on Chronochat-Android (this seems to occur every time a message is exchanged in Chronosync)
07-27 15:13:59.919 12145-12193/com.example.ezl.ndnradiotest E/PendingInterestTable: Error in onTimeout
java.lang.IndexOutOfBoundsException: Index: 4, Size: 2
at java.util.ArrayList.get(ArrayList.java:411)
at net.named_data.jndn.Name.get(Name.java:681)
at net.named_data.jndn.sync.ChronoSync2013.onTimeout(ChronoSync2013.java:827)
at net.named_data.jndn.impl.PendingInterestTable$Entry.callTimeout(PendingInterestTable.java:110)
at net.named_data.jndn.Node.processInterestTimeout(Node.java:541)
at net.named_data.jndn.Node.access$400(Node.java:50)
at net.named_data.jndn.Node$4.run(Node.java:586)
at net.named_data.jndn.impl.DelayedCallTable$Entry.callCallback(DelayedCallTable.java:113)
at net.named_data.jndn.impl.DelayedCallTable.callTimedOut(DelayedCallTable.java:79)
at net.named_data.jndn.Node.processEvents(Node.java:369)
at net.named_data.jndn.Face.processEvents(Face.java:1361)
at com.example.ezl.ndnradiotest.ChronoSyncService$1.run(ChronoSyncService.java:81)
at java.lang.Thread.run(Thread.java:761)
Updated by Edward Lu over 6 years ago
Creating a ChronoSync2013 object with a broadcastprefix with less than 4 name components will lead to this error, meaning that regular sync interests are not sent out and every time new data is published it is treated as a recovery from a partition by other members in the sync group.
'''
07-27 15:13:59.919 12145-12193/com.example.ezl.ndnradiotest E/PendingInterestTable: Error in onTimeout
java.lang.IndexOutOfBoundsException: Index: 4, Size: 2
at java.util.ArrayList.get(ArrayList.java:411)
at net.named_data.jndn.Name.get(Name.java:681)
at net.named_data.jndn.sync.ChronoSync2013.onTimeout(ChronoSync2013.java:827)
at net.named_data.jndn.impl.PendingInterestTable$Entry.callTimeout(PendingInterestTable.java:110)
at net.named_data.jndn.Node.processInterestTimeout(Node.java:541)
at net.named_data.jndn.Node.access$400(Node.java:50)
at net.named_data.jndn.Node$4.run(Node.java:586)
at net.named_data.jndn.impl.DelayedCallTable$Entry.callCallback(DelayedCallTable.java:113)
at net.named_data.jndn.impl.DelayedCallTable.callTimedOut(DelayedCallTable.java:79)
at net.named_data.jndn.Node.processEvents(Node.java:369)
at net.named_data.jndn.Face.processEvents(Face.java:1361)
at com.example.ezl.ndnradiotest.ChronoSyncService$1.run(ChronoSyncService.java:81)
at java.lang.Thread.run(Thread.java:761)
'''
Updated by Anonymous over 6 years ago
Hi Edward. When you get this error, can you print out the values of interest.getName().toUri() and applicationBroadcastPrefix_.toUri() ? And post the result on this issue?
https://github.com/named-data/jndn/blob/master/src/net/named_data/jndn/sync/ChronoSync2013.java#L827
Updated by Anonymous over 6 years ago
(I ask for the print out values because I made a broadcast prefix of 3 components, and I couldn't reproduce the error.)
Updated by Edward Lu over 6 years ago
Ah I found the reason was because I hadn't updated jndn; I was using 0.17, but the issue goes away with 0.18.
Updated by Anonymous over 6 years ago
- Status changed from New to Closed
OK. Thanks for figuring that out. I'll close the issue.