Our streams are occasionally getting closed with an exception like
:[-StreamThread-1] org.apache.kafka.streams.KafkaStreams : stream-client [alarms-HIGH] All stream threads have died. The instance will be in error state and should be closed.
Exception in thread "alarms-HIGH-StreamThread-1" java.nio.BufferUnderflowException
at java.base/java.nio.HeapByteBuffer.get(Unknown Source)
at java.base/java.nio.ByteBuffer.get(Unknown Source)
at org.apache.kafka.streams.state.internals.BufferValue.extractValue(BufferValue.java:94)
at org.apache.kafka.streams.state.internals.BufferValue.deserialize(BufferValue.java:83)
at org.apache.kafka.streams.state.internals.InMemoryTimeOrderedKeyValueBuffer.restoreBatch(InMemoryTimeOrderedKeyValueBuffer.java:347)
at org.apache.kafka.streams.processor.internals.CompositeRestoreListener.restoreBatch(CompositeRestoreListener.java:89)
at org.apache.kafka.streams.processor.internals.StateRestorer.restore(StateRestorer.java:92)
at org.apache.kafka.streams.processor.internals.StoreChangelogReader.processNext(StoreChangelogReader.java:349)
at org.apache.kafka.streams.processor.internals.StoreChangelogReader.restore(StoreChangelogReader.java:93)
at org.apache.kafka.streams.processor.internals.TaskManager.updateNewAndRestoringTasks(TaskManager.java:389)
at org.apache.kafka.streams.processor.internals.StreamThread.runOnce(StreamThread.java:769)
at org.apache.kafka.streams.processor.internals.StreamThread.runLoop(StreamThread.java:698)
at org.apache.kafka.streams.processor.internals.StreamThread.run(StreamThread.java:671)
(This is Spring boot 2.2.5, Spring kafka 2.3.6)Is this a memory related error ?Anyone aware if there is a way to recover from this error?