Max buffer size not exceeding 262144 (Buffer overflow exception)
See original GitHub issueHi all,
I have been using the library in one of my projects where a large number of akka messages are being sent around. This culminates in a large aggregate message being generated which causes a com.esotericsoftware.kryo.KryoException: Buffer overflow
exception to be thrown. In response to this I have increased the buffer-size and max-buffer-size multiple times (even to max_int), but to no avail. The maximum size of this data is ~40MB, which is obviously a lot smaller than this 2GB buffer.
I have been debugging this for the last couple of hour, following the error through to the ByteBufferOutput class, and it appears that the maxCapacity never exceeds 262144 (as can be seen in the screenshot above). I can’t seem to find anywhere that I could change/set this number. It also appears that the ByteBufferOutput constructor where the maxCapacity isn’t passed through (line 66) is the one being called, which could be the cause of all of this.
I am using your latest version (“io.altoo” %% “akka-kryo-serialization” % “2.2.0”)/akka version 2.6.14, and other than registering my classes/changing the buffer size, all the settings are as in reference conf. This can be seen here if of any assistance.
It’s very much possible I am being an idiot and missed something, so if you can point me in the right direction that would be fantastic. If not and this is an issue I am more than happy to provide a more detailed run down of reproducing the problem and to help engineer a solution.
All the best, Ben
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
@miratepuffin Glad you found the issue 👍 and thx for the feedback!
Hi @danischroeter,
Thank you for going through the effort of looking into this. I have found the source of the issue and it was actually a misconfigured
maximum-frame-size
. I had a good delve through the conf and found that it had changed position in akka 2.6, hence why it was working before and not with my swap into artery/kryo. I apologise for the wasted time, but cheers for the advice and the rubber ducking 😄 best of luck with everything and thanks for making such a fab library.EDIT: Just a point actually, it may be worth putting a note in the readme or your reference conf that your
max-buffer-size
cannot exceedakka.remote.artery.advanced.maximum-frame-size
and will throw the buffer overflow exception.All the best, Ben