Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onMessage Exception #1009

Closed
zhangyongjiang opened this issue May 25, 2024 · 3 comments · Fixed by #1010
Closed

onMessage Exception #1009

zhangyongjiang opened this issue May 25, 2024 · 3 comments · Fixed by #1010
Assignees
Labels
bug Something isn't working. It's clear that this does need to be fixed.

Comments

@zhangyongjiang
Copy link

zhangyongjiang commented May 25, 2024

Stack Trace:

(ERROR): io.ably.lib.transport.WebSocketTransport: Unexpected exception processing received binary message
io.ably.lib.types.AblyException: java.lang.IndexOutOfBoundsException: toIndex = 9
at io.ably.lib.types.AblyException.fromThrowable(AblyException.java:54)
at io.ably.lib.transport.ConnectionManager.onMessage(ConnectionManager.java:1187)
at io.ably.lib.transport.WebSocketTransport.receive(WebSocketTransport.java:104)
at io.ably.lib.transport.WebSocketTransport$WsClient.onMessage(WebSocketTransport.java:198)
at org.java_websocket.client.WebSocketClient.onWebsocketMessage(WebSocketClient.java:641)
at org.java_websocket.drafts.Draft_6455.processFrameBinary(Draft_6455.java:959)
at org.java_websocket.drafts.Draft_6455.processFrame(Draft_6455.java:912)
at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:401)
at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:233)
at org.java_websocket.client.WebSocketClient.run(WebSocketClient.java:516)
at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.lang.IndexOutOfBoundsException: toIndex = 9
at java.base/java.util.AbstractList.subListRangeCheck(AbstractList.java:507)
at java.base/java.util.ArrayList.subList(ArrayList.java:1108)
at io.ably.lib.transport.ConnectionManager$PendingMessageQueue.ack(ConnectionManager.java:1698)
at io.ably.lib.transport.ConnectionManager.onAck(ConnectionManager.java:1318)
at io.ably.lib.transport.ConnectionManager.onMessage(ConnectionManager.java:1173)
... 9 more

┆Issue is synchronized with this Jira Bug by Unito

@lawrence-forooghian
Copy link
Collaborator

Thanks for the bug report @zhangyongjiang; the SDK definitely shouldn't be crashing. A couple of questions which will help us to investigate:

  1. Please could you tell us your steps to reproduce? Is it something that you can reproduce consistently?
  2. It looks like you're using ably-java 1.2.38, is that right?

@lawrence-forooghian lawrence-forooghian added the bug Something isn't working. It's clear that this does need to be fixed. label May 28, 2024
@zhangyongjiang
Copy link
Author

zhangyongjiang commented May 30, 2024

@lawrence-forooghian
Yes, we are using ably-java 1.2.38.
I cannot reproduce the bug always. You may try these steps back and forth.

  1. create few ably realtime instances,
  2. for each ably realtime instance
  • subscribe to a channel (same channel for all instances).
  • use a thread to publish messages to the channel every 10 seconds
  1. disconnect the network (turn off wifi) for few minutes
  2. turn on network, wait for couple minutes
  3. repeat step 6 and 7

@ttypic
Copy link
Contributor

ttypic commented Jun 3, 2024

Hey @zhangyongjiang,

We have released version 1.2.39 of ably-java, which includes a fix for the reported issue. If you continue to experience the problem after updating, please feel free to reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. It's clear that this does need to be fixed.
Development

Successfully merging a pull request may close this issue.

3 participants