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
JGRP-2242 Narrow set of thrown exceptions in Streamable and Marshaller method signatures. #423
Conversation
What's the rationale again for changing almost all of JGroups? :-) |
…r method signatures.
Do you have an example (code)? |
Hmm... so your code throws an IOException... But [1] is inconsistent: it throw IOException on write() and also on read(), but other code throws I'll think about this |
OK, so both methods will only throw an IOException. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I'll take a look, too. I'm currently busy with the port to Quarkus, but will take a look early next week. |
I don't like having to add a |
That would be a welcome improvement. |
For internal messages, yes. However, the message I would be most concerned about are those created and sent by the user. When these messages are serialized, you wrap the DataInput/DataOutput with an ObjectOutputStream/ObjectInputStream whenever you encounter a Serializable object.
I understand why you want to avoid the use of ObjectOutput/ObjectInput whenever possible, as it adds quite a bit of overhead to the stream (~50-60 bytes). The current approach is fine, so long as you only ever write at most a single serializable object to the stream. However, as soon as you write multiple serializable objects to a stream, you'll multiply this overhead unnecessarily instead of incurring it only once. While it is reasonable to assume that most user created messages will probably only contain a single serializable object, a batch of those same messages (which are serialized to a single stream) incur accumulated overhead that could otherwise be avoided if we were writing to a single ObjectOutput stream. |
OK. I'll accept your PR, but will make additional modifications, as not all methods (e.g. in Util) have the correct exceptions. |
Pushed to master. Let me know if this works for you |
That works. Thanks! |
https://issues.jboss.org/browse/JGRP-2242
Now that 4.0.x was branched, perhaps this is ready for inclusion?