-
Notifications
You must be signed in to change notification settings - Fork 159
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
ArrayIndexOutOfBoundsException on attempt to reconnect #644
Comments
Linux core version 5.4.170 |
@igor-komar You say "message consumption was healthy", what does this mean? If the output queue is full, it seems that it's having difficulty sending those messages to the server in a timely fashion. How big are your message payloads? |
@scottf "message consumption was healthy" means that messages receiving was NOT interrupted on the service, only publishing didn't work. |
Is the consumption on the same connection as the production? I'm trying to understand why you noted consumption. I recognize that something bad is happening when publish is stopped because of a full output queue, but am really trying to understand how the queue got full in the first place. |
Yes, consumption is on the same connection as the production.
It was the problem of exactly this affected instance. Other instances of the same service were consuming and publishing |
I also encountered this exact issue. I did not manage to capture a stack trace, somehow it got swallowed, not sure why. First, we get the queue full error: Relevant version numbers:
Edit: also relevant of course, the client was publishing to an on-disk jetstream, with this config:
Publishing was done using |
@scottf, I have been looking into the code and I believe I've found what goes wrong in
However, I believe two things go wrong for the following piece of code in
Something that I find a bit curious though, why the
But, why does the Using a
|
Created a PR for this in advance 🙂 |
Ok I think I see it now. We advance the msg to the next, but never send the one that would have been too big for the buffer. It probably doesn't happen much because of how often we run this code and the default buffer is plenty big, but on cases where the buffer was small or the message was really big, this can happen a lot. |
Yeah, I believe changing this into the |
@igor-komar @michelwilson There is a fix in the main branch and should be available in 2.16.1-SNAPSHOT on Sonatype |
Small update from my end. Have not been able to reproduce this error reliably (if at all) on our setup.. Seems like it takes a really long time to get into this state, or is just "luck". |
Another update, we've updated to version 2.16.1 yesterday and are still encountering this issue sadly.
Will add the |
I wonder if I should just switch to using the ByteArrayBuilder which just automatically expands and uses ByteBuffer under the covers. |
@scottf Got a full stacktrace this time:
However, before this it seems like messages can't be sent anymore at all:
Not quite sure what's the root cause. It seems like something is going wrong even prior to the out of bounds. |
What can I do do reproduce this? |
Not sure how to reproduce it yet. Currently trying to dig through the logs to get more clarity. Looking a bit more in the logs for a timeline:
|
Our way of "reproducing" this so far was running it for a day or two until it eventually goes into this state, but that isn't really a reliable way 😓 |
@igor-komar @michelwilson This issue has been fixed in PR #820 and released in 2.16.6 |
Defect
We observed one of our Nats clients in our production enviroment flooded log with the following exceptions.
Our client configuration:
We don't have a reproduction scenario yet.
Versions of
io.nats:jnats
andnats-server
:nats server v 2.7.4
jnats v 2.14.1
OS/Container environment:
adoptopenjdk/openjdk11:jdk-11.0.8_10-alpine
Steps or code to reproduce the issue:
Expected result:
Actual result:
The text was updated successfully, but these errors were encountered: