-
Notifications
You must be signed in to change notification settings - Fork 818
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
0.14: NotSerializableException: io.moquette.broker.SessionRegistry$PublishedMessage #566
Comments
I just got the exception again, but this time I could still get at the entire log file. The exception happens out of the blue, with no prior errors. |
Finally managed to reliably reproduce it reliably. All one needs to do is have a SessionRegistry$PublishedMessage be stored in H2. That however, is easier said than done :) Fast way to reproduce:
What it does:
Why this reproduces it: The breakpoint makes sure that any message put on the queue is not removed, thus making H2 store it as soon as the autosave triggers (every second) |
…ishedMessage Instances of implementations of the interface SessionRegistry$EnqueuedMessage are put in the queue, which can be backed by the H2 store. But since this class is not serializable, H2 can not store it. This commit makes the interface serializable, and deals with the non-serializable ByteBuf that the PublishedMessage subclass has as a field.
I've created a PR that seems to fix the problem. I'm pretty sure I got the serialization of the ByteBuf correct. |
I'm testing 0.14 on our server, and woke up to a console filled with the below exception.
SessionRegistry.PublishedMessage and its superclass do not implement Serializable. Should they be put into the store?
Expected behavior
No exceptions...
Actual behavior
Steps to reproduce
See below
Minimal yet complete reproducer code (or URL to code) or complete log file
See below
Moquette MQTT version
JVM version (e.g.
java -version
)OS version (e.g.
uname -a
)Linux
The text was updated successfully, but these errors were encountered: